fix(examples): z80-led-chaser-c used invalid SDCC __at() cast syntax
`(*(volatile unsigned char __at(0xC000)))` uses __at as a cast operator, which neither avr-gcc nor sdcc accept (sdcc: "syntax error: token -> ')'"). __at is a storage specifier, not an operator. Use the portable absolute- address pointer form `(*(volatile unsigned char *)0xC000)`, which sdcc -mz80 compiles cleanly. Verified: produces a 462-byte ROM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
4cb5748dce
commit
a77dbcafad
|
|
@ -42,8 +42,8 @@ const chaserZ80C = `/* LED chaser written in C, compiled to Z80 by SDCC.
|
|||
* Behaviour: walks a single LED back and forth across the 8 outputs
|
||||
* (true Larson scanner, with direction reversal).
|
||||
*/
|
||||
#define LED_OUT (*(volatile unsigned char __at(0xC000)))
|
||||
#define BTN_IN (*(volatile unsigned char __at(0xC003)))
|
||||
#define LED_OUT (*(volatile unsigned char *)0xC000)
|
||||
#define BTN_IN (*(volatile unsigned char *)0xC003)
|
||||
|
||||
static void delay(unsigned int loops) {
|
||||
while (loops--) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue