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:
David Montero 2026-06-03 05:53:53 +02:00
parent 4cb5748dce
commit a77dbcafad
1 changed files with 2 additions and 2 deletions

View File

@ -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 * Behaviour: walks a single LED back and forth across the 8 outputs
* (true Larson scanner, with direction reversal). * (true Larson scanner, with direction reversal).
*/ */
#define LED_OUT (*(volatile unsigned char __at(0xC000))) #define LED_OUT (*(volatile unsigned char *)0xC000)
#define BTN_IN (*(volatile unsigned char __at(0xC003))) #define BTN_IN (*(volatile unsigned char *)0xC003)
static void delay(unsigned int loops) { static void delay(unsigned int loops) {
while (loops--) { while (loops--) {