-
Variable passing
When passing the variable bytes to the loadBytes function, it somehow get the value zero when treated in the stackwrite function. If I set the value bVar to any constant value it's ok.
Code:
byte bytes[64];
bytes[0] = 0xef;
bytes[1] = 0xcd;
void loadBytes(int addr, int n, byte *bytes) {
uint16 bVar;
bVar = (uint16)bytes[0]|((uint16)bytes[1]<<8);
for (j=0; j<1; j++)
{
StackWrite(sibleyStack,0, bVar);
}
}
lodBytes(0, 0, bytes);
Please help me out here.
-
sorry about the misspelled loadBytes in the end (that's not the error though, hehehe)!!
-
the last parameter to loadBytes is a pointer, you are passing a single integer (assuming uint16 is typedefed as unsigned int). Didn't your compiler produce an error about that?