From cc9d915435a61d71f11cffa264cf941de58fe444 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 4 Feb 2026 11:04:04 +0530 Subject: Switch from internal clock to crystal + button --- test/stubbed/avr/fuse.h | 12 ++++++++++++ test/stubbed/avr/io.h | 42 +++++++++++++++++++++++------------------- test/stubbed/util/delay.h | 6 +++++- 3 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 test/stubbed/avr/fuse.h (limited to 'test') diff --git a/test/stubbed/avr/fuse.h b/test/stubbed/avr/fuse.h new file mode 100644 index 0000000..be579d3 --- /dev/null +++ b/test/stubbed/avr/fuse.h @@ -0,0 +1,12 @@ +#ifndef STUB_AVR_FUSE +#define STUB_AVR_FUSE + +struct __fuses_t { + int high; + int low; + int extended; +}; + +#define FUSES const struct __fuses_t _watch_mcu_fuses_configuration + +#endif diff --git a/test/stubbed/avr/io.h b/test/stubbed/avr/io.h index cd4a7bc..cfbdef3 100644 --- a/test/stubbed/avr/io.h +++ b/test/stubbed/avr/io.h @@ -1,24 +1,28 @@ +#ifndef STUB_AVR_IO +#define STUB_AVR_IO #include -int DDRA = 0; -int DDRB = 0; +static int DDRA = 0; +static int DDRB = 0; -int PORTA = 0; -int PORTB = 0; +static int PORTA = 0; +static int PORTB = 0; +static int PINA = 0; +static int PINB = 0; -int PA1 = 1; -int PA2 = 2; -int PA3 = 3; -int PA4 = 4; -int PA5 = 5; -int PA6 = 6; -int PA7 = 7; - -int PB1 = 1; -int PB2 = 2; -int PB3 = 3; -int PB4 = 4; -int PB5 = 5; -int PB6 = 6; -int PB7 = 7; +#define PA1 1 +#define PA2 2 +#define PA3 3 +#define PA4 4 +#define PA5 5 +#define PA6 6 +#define PA7 7 +#define PB1 1 +#define PB2 2 +#define PB3 3 +#define PB4 4 +#define PB5 5 +#define PB6 6 +#define PB7 7 +#endif diff --git a/test/stubbed/util/delay.h b/test/stubbed/util/delay.h index ce4323e..db61690 100644 --- a/test/stubbed/util/delay.h +++ b/test/stubbed/util/delay.h @@ -1,5 +1,9 @@ +#ifndef STUB_UTIL_DELAY +#define STUB_UTIL_DELAY + #include -void _delay_ms(int ms) { +static void _delay_ms(int ms) { usleep(ms * 1000); } +#endif -- cgit v1.3.1