This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

local variables not showing correct value

Hi,

Am I doing something wrong?
The local variable below called 'test_byte' is used to hold return values from function 'ser_buff_read_byte ()'. The value returned is always 0x1D both in the watch window and when I hovered over it! This is not the value returned, in fact I cahnged the code to always return 0x05 and it still did not work!! When I change test_byte to a static it does work???

Help please!!

Ian



void main (void) {
/* Start with 'init' task. */

U8 i;
U8 test_byte;

ser_buff_write_array (debug_buffer, 3); // debug test write 3 bytes
test_byte = ser_buff_read_byte (); // debug test read 1 byte
ser_buff_write_array (debug_buffer, 4); // debug test write 4 bytes
test_byte = ser_buff_read_byte (); // debug test read 1 byte
test_byte = ser_buff_read_byte (); // debug test read 1 byte
ser_buff_write_array (debug_buffer, 6); // debug test write 4 bytes

while(ser_buff_read_ready ()) // debug test read all byte
{
test_byte = ser_buff_read_byte ();
}
ser_buff_write_array (debug_buffer, 2); // debug test write 4 bytes


os_sys_init(init);
while(1);
}

Parents Reply Children
No data