Quote:
|
Originally Posted by russell
Hmmm. I just tried to compile it and I got a bunch of errors.....
what does that mean?
|
It looks like you didn't follow ALL the instructions:
Quote:
|
Originally Posted by Meandmyself
address and address2 are unsigned shorts defined in user_routines.c and _fast.c respectively.
|
Try reading the whole post carefully.
FWIW, the lines should probably be something like:
Code:
unsigned short address; // In user_routines.c
and
unsigned short address2; // In user_routines_fast.c
Actually, since I didn't see anywhere in the code snippets where the address variables are initialized, that should be:
Code:
unsigned short address = 0; // In user_routines.c
and
unsigned short address2 = 0; // In user_routines_fast.c
And assuming that these variables don't need to be used outside of these modules, I would make them:
Code:
static unsigned short address = 0; // In user_routines.c
and
static unsigned short address2 = 0; // In user_routines_fast.c
Further, it looks to me like these address variables aren't needed outside of the storemotors and readmotors functions so, IMHO, these variable declarations should be moved inside their respective functions. E.g.:
Code:
void storemotors(void)
{
static unsigned short address = 0;
static char lr = 0;
if (lr==0) //alternate writing lmotor & rmotor
etc.
}//end storemotors