View unanswered posts | View active topics It is currently Tue Sep 30, 2014 5:55 pm






Reply to topic  [ 6 posts ] 
RobotC 3.04 error (waitforstart) 
Author Message
Rookie

Joined: Sun Feb 27, 2011 3:41 pm
Posts: 20
Post RobotC 3.04 error (waitforstart)
I just figured out that whenever


bDisplayDiagnostics = false;
bDisplayDiagnostics = true;
waitForStart();
//Do something


is set, the waitforstart gets overridden for some reason. Please let me know if this is a bug in the robotC. Our team needs this in order for our autonomous to work properly and our first competition is on Saturday....

Thanks,
Rohit


Wed Jan 11, 2012 8:11 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: RobotC 3.04 error (waitforstart)
It sounds like it could be related to these threads (there is a solution towards the end of the thread) and it is supposed to be fixed by the yet to be released 3.05.
viewtopic.php?f=52&t=3777&p=16086&hilit=+hogCPU#p16086

viewtopic.php?f=52&t=3448&start=30


Wed Jan 11, 2012 8:22 pm
Profile
Rookie

Joined: Sun Feb 27, 2011 3:41 pm
Posts: 20
Post Re: RobotC 3.04 error (waitforstart)
Thank you so much. I will see if this works...


Wed Jan 11, 2012 8:55 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: RobotC 3.04 error (waitforstart)
Note that the RobotC folks implied their fix in 3.05 is more than one place. There are a number of threads accessing the joystick structure. So if any of them is not protected by a critical section, you will have this problem. The one I found was in joystick.c and happens to be open-source so I can fix it. But if there are other places in RobotC that have similar problem, you may not be able to fix it since you don't have source code to those.


Wed Jan 11, 2012 9:14 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 604
Post Re: RobotC 3.04 error (waitforstart)
Here's what the 3.05 version looks like (should be out today or tomorrow, we're working hard on it!)

You can modify your driver to include this beforehand if you need to test/fix ASAP.

Code:
if (!bMsgFound)
        {
          if (nNoMessageCounter > nNoMessageCounterLimit)
          {
            hogCPU();
            if (!bOverrideJoystickDisabling)
            {
              bTempUserMode = joystickCopy.UserMode;
              bTempStopPgm = joystickCopy.StopPgm;

              memset(joystickCopy, 0, sizeof(joystickCopy));

              joystickCopy.UserMode = bTempUserMode;
              joystickCopy.StopPgm = bTempStopPgm;
              joystickCopy.joy1_TopHat = -1;
              joystickCopy.joy2_TopHat = -1;
            }
            bDisconnected = true;
            releaseCPU();
          }
          wait1Msec(4);    // Give other tasks a chance to run
          nNoMessageCounter++;
          continue;        // No message this time. Loop again
        }
        else
        {
          bDisconnected = false;
          nNoMessageCounter = 0;
          break;
        }

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Thu Jan 12, 2012 11:42 am
Profile
Rookie

Joined: Sun Feb 27, 2011 3:41 pm
Posts: 20
Post Re: RobotC 3.04 error (waitforstart)
Thanks!


Fri Jan 13, 2012 11:42 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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.