Quote:
|
Originally Posted by mtrawls
I realize some code might help, but as I said, I'm about to take a test and the code is on the team laptop, so I'll get around to it sometime tomorrow maybe.
|
Thanks for the help. Who would have thought that sleep depravation, loud noise, small rooms, and flying metal sparks wouldn't have been the optimum environment for programming? It is sad, sad day ...
Anyway, I'll post that code now.
Code:
static unsigned int Old_Clock = 0;
static unsigned char drive_timer = 0;
...
/* Add your own autonomous code here. */
if (Clock > Old_Clock)
{
switch (Navigator_State) { ... }
}
Old_Clock = Clock; // take a snapshot of the clock
For some reason the clock is not increasing. Now, since we are presently making our auton switch, I did some kludging to get it called; I called User_Autonomous_Mode (where this code is at) from Process_Data_From_Local_uP, and edited as such:
Code:
// while (autonomous_mode) /* DO NOT CHANGE! */
while (1) // just so auto is executed now, for testing
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */
// PUT THE ABOVE CODE RIGHT HERE
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
I think the problem might be that I have the code in the 26.2ms loop area -- or at least I have an inclination I don't want it there. But would that explain why the timer interrupt doesn't appear to be interrupting? Maybe I copied the code down incorrectly when switching from Edu to RC. Thanks for all the help ..