View unanswered posts | View active topics It is currently Sat Oct 25, 2014 10:44 am






Reply to topic  [ 7 posts ] 
nxtDisplay... strings cause Click of Death in 3.62 
Author Message
Rookie

Joined: Fri Nov 19, 2010 3:34 pm
Posts: 14
Post nxtDisplay... strings cause Click of Death in 3.62
On 2 different bricks, the following code works fine in RobotC for Mindstorms +Tetrix 3.55, but causes the NXT Click of Death in 3.62:

Code:
task main(){
  int counter = 0;
  while (counter < 30) {
    counter++;
    eraseDisplay();
    nxtDisplayBigTextLine(1, "%s", "Test");  // same result with nxtDisplayCenteredBigTextLine()
    nxtDisplayBigTextLine(3, "%d", counter);  // same result with nxtDisplayCenteredBigTextLine()
    wait1Msec(200);
  }
}


The following code, changing the line 1 parameter from a string to a string variable, fixes it:

Code:
task main(){
  int counter = 0;
  string msg = "Test";
  while (counter < 30) {
    counter++;
    eraseDisplay();
    nxtDisplayBigTextLine(1, "%s", msg);  // same result with nxtDisplayCenteredBigTextLine()
    nxtDisplayBigTextLine(3, "%d", counter);  // same result with nxtDisplayCenteredBigTextLine()
    wait1Msec(200);
  }
}


Could you shed some light on what's going on? Are you able to reproduce this?
Thanks,


Wed Dec 25, 2013 2:29 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: nxtDisplay... strings cause Click of Death in 3.62
A bug it may be, but why would you use nxtDisplayBigTextLine(1, "%s", "Test"); and not nxtDisplayBigTextLine(1, "Test"); ?

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Dec 25, 2013 5:31 pm
Profile WWW
Rookie

Joined: Fri Nov 19, 2010 3:34 pm
Posts: 14
Post Re: nxtDisplay... strings cause Click of Death in 3.62
Well, eliminating the "%s" is certainly how we'll fix our code.

That seems to be the only issue with 3.62 we've found so far.

FTC 6002


Fri Dec 27, 2013 12:19 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: nxtDisplay... strings cause Click of Death in 3.62
It's deffo a bug, however, it's easy to work around it :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Dec 27, 2013 12:46 pm
Profile WWW
Rookie

Joined: Fri Nov 19, 2010 3:34 pm
Posts: 14
Post Re: nxtDisplay... strings cause Click of Death in 3.62
Easy to work around, but a nasty one though. Compiles just fine. It's only when your code runs across that statement that it goes into the click of death with very little to hint at what happened.


Sat Dec 28, 2013 10:08 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: nxtDisplay... strings cause Click of Death in 3.62
then you're quite lucky to have RobotC to program with, getting even "very little to hint at what happened".
I just got a few steps of experience with "real" C.
Here you do not even get the slightest hint when everything just dissolves into nothingness. ;)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sat Dec 28, 2013 10:28 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: nxtDisplay... strings cause Click of Death in 3.62
Ford,

With remote gdb you can do it, but you'd have to learn how to use this very powerful (and hard to use) tool. ROBOTC's debugger is much easier to use. When I have issues like this, I will often leave "breadcrumbs" as I go through the program, using writeDebugStreamLine();

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Dec 28, 2013 10:39 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.