Hi,
I am A littlebit frustrated at the moment.
My version of the AS5 is at the bottom of this topic.
If I go from 03,0s to 0o everything works just find in some parts of my code. If I enable 0s or 03 I get strange thing to happen.
This function for example is returning wrong values.
Inside my uart_getchar_forground_rf_short() I could read the correct value which is 0xFF00. but the pi_temp.SOURCEID is set to zero after this two lines (yes, I am sure that my getchar returns 0xFF00).
int uart_getchar_foreground_rf_short() { unsigned char data; if (uartRf.foreground_rx_head_short == uartRf.RxTailShort) { return EOF; /* no data available */ } data = uartRf.RxBuf[uartRf.RxTailShort]; uartRf.RxTailShort = ((uartRf.RxTailShort + 1) & RxMask); return (int)data; }
uint16_t test1 = uart_getchar_foreground_rf_short(); uint16_t test2 = uart_getchar_foreground_rf_short();
pi_temp.SOURCEID = ((uint16_t)uart_getchar_foreground_rf_short() << 8); pi_temp.SOURCEID |= (uint16_t)uart_getchar_foreground_rf_short();
If I use the following I am able to read 0xFF to test1 and 0x00 to test2
This code has been runned on the AS4 with GCC for over a year without this problem.
What is it to do. This kind of problem is one of the worst I think. Is it best to not use optimizing? That is not the common way of doing thing but Right know I cant see other solutions.
Regards ellile
- Atmel AVR Studio 5 (Version: 5.0.1163)
© 2011 Atmel Corp.
All rights reserved.
AVR GCC 8-bit Toolchain
Version: gcc version 4.5.1 (AVR_8_bit_GNU_Toolchain_3.2.3_315)
AVR GCC 32-bit Toolchain
Version: gcc version 4.4.3 (AVR_32_bit_GNU_Toolchain_3.2.3_261)
AVR Software Framework
Version: ASF-2.5.1-17860.53