Closed nerdralph closed 4 years ago
Good find! And you've verified that the code still writes the intended value to TH1? Happy to accept a pull request or make the change, whichever you'd prefer.
I haven't tested the UARTs on my modules, but the asm code looks good with 16M FREQ_SYS:
mov _TH1,#0x98
0-0x98 = 104, 16M/16/104 = 9,615bps
With 12M for FREQ_SYS it 0xB2 instead of 0x98.
Excellent!
https://github.com/Blinkinlabs/ch554_sdcc/blob/master/include/debug.c#L164 Making them volatile stops SDCC from doing constant folding and propagation, which bloats the code size. By making them non-volatile, the blink example compiles to 364 bytes instead of 700.