Hi All.
I have the following problem with some autogenerated code (from nesC in
my TinyOS port to 8051*). It seems that a fairly obscure "= ? :" causes
problems with sdcc. The statement returns a bunch of warnings and fails
in the assembler with the following error:
sdcc -mmcs51 test_condit.c
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
test_condit.c:15: warning 94: comparison is always false due to limited
range of data type
?ASxxxx-Error-<o> in line 136 of test_condit.asm
<o> .org in REL area or directive / mnemonic error
...
Is the statement a valid C statement?
* Again, check out the following if you are interested:
http://www.tinyos8051wg.net
--
Regards Martin Leopold.
Dept. of Computer Science, University of Copenhagen
http://www.diku.dk/~leopold
__sfr __at (0xC5) U0GCR;
__sfr __at (0xC6) CLKCON;
enum __nesc_unnamed4261 {
CC2430_CLKCON_OSC32K = 7,
CC2430_CLKCON_OSC = 6,
CC2430_CLKCON_TICKSPD = 3,
CC2430_CLKCON_CLKSPD = 0,
CC2430_CLKCON_TICKSPD_MASK = 0x38
};
int main(void) {
U0GCR = 230400 == 2400 ? 6 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 4800 ? 7 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 9600 ? 8 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 14400 ? 8 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 19200 ? 9 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 28800 ? 9 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 38400 ? 10 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 57600 ? 10 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 76800 ? 11 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 115200 ? 11 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 153600 ? 12 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 230400 ? 12 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 230400 == 307200 ? 13 + ((CLKCON & (1 << CC2430_CLKCON_OSC)) >> CC2430_CLKCON_OSC) : 0;
return 0;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user