From: Manfred Steiner Date: Thu, 15 Aug 2024 14:15:58 +0000 (+0200) Subject: Atmega1284P -> software/nano-1284/test_2024-07-23 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=541dd70c7a1714073cf3e0347ecd8c6897531550;p=nano-x-base.git Atmega1284P -> software/nano-1284/test_2024-07-23 --- diff --git a/software/nano-1284/test_2024-07-23/.gdb_history b/software/nano-1284/test_2024-07-23/.gdb_history new file mode 100644 index 0000000..3339046 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.gdb_history @@ -0,0 +1,9 @@ +target remote :1234 +layout split +stepi +quit +target remote :1234 +layout split +stepi +b *main+9 +quit diff --git a/software/nano-1284/test_2024-07-23/.gdbinit b/software/nano-1284/test_2024-07-23/.gdbinit new file mode 100644 index 0000000..139597f --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.gdbinit @@ -0,0 +1,2 @@ + + diff --git a/software/nano-1284/test_2024-07-23/.gitignore b/software/nano-1284/test_2024-07-23/.gitignore new file mode 100644 index 0000000..a959910 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.gitignore @@ -0,0 +1,4 @@ +.depend +**/build +**/dist +**/sim diff --git a/software/nano-1284/test_2024-07-23/.vscode/c_cpp_properties.json b/software/nano-1284/test_2024-07-23/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..dda83a0 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "Linux AVR", + "includePath": [ + "/usr/lib/avr/include/**", + "/usr/lib/gcc/avr/**" + ], + "defines": [], + "compilerPath": "/usr/bin/avr-gcc", + "compilerArgs": [ "-mmcu=atmega1284p", "-DF_CPU=12000000", "-Os" ], + "cStandard": "gnu11", + "cppStandard": "gnu++11", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 +} diff --git a/software/nano-1284/test_2024-07-23/.vscode/launch.json b/software/nano-1284/test_2024-07-23/.vscode/launch.json new file mode 100644 index 0000000..f29cf2e --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.vscode/launch.json @@ -0,0 +1,37 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Build", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "build" + },{ + "name": "Flash", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "flash" + },{ + "name": "Clean", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "clean" + },{ + // es muss mit simuc --board arduino dist/programm.elf der Simulator + // gestartet werden. Dessen gdb-stub öffnet auf localhost:1234 einen Port + "name": "Debug (simuc)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/sim/atmega328p.elf", + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/avr-gdb", + "miDebuggerServerAddress": ":1234", + "preLaunchTask": "build" + } + ] +} diff --git a/software/nano-1284/test_2024-07-23/.vscode/settings.json b/software/nano-1284/test_2024-07-23/.vscode/settings.json new file mode 100644 index 0000000..58539af --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.vscode/settings.json @@ -0,0 +1,29 @@ +{ + "[c]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "[cpp]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "[h]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "[hpp]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "cSpell.words": [], + "cSpell.ignorePaths": [ + "**/*.json", "**/*.c", "**/*.h", "**/*.cpp", "**/*.hpp", "**/Makefile" + ], + "java.project.sourcePaths": [ + "src/units" + ] +} diff --git a/software/nano-1284/test_2024-07-23/.vscode/tasks.json b/software/nano-1284/test_2024-07-23/.vscode/tasks.json new file mode 100644 index 0000000..74fb1c7 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [{ + "label": "build", + "type": "shell", + "command": "make", + "problemMatcher":[ + "$gcc" + ] + },{ + "label": "clean", + "type": "shell", + "command": "make", + "args": [ "clean" ], + },{ + "label": "flash", + "type": "shell", + "command": "make", + "args": [ "flash" ], + }] +} \ No newline at end of file diff --git a/software/nano-1284/test_2024-07-23/Makefile b/software/nano-1284/test_2024-07-23/Makefile new file mode 100644 index 0000000..88e53cd --- /dev/null +++ b/software/nano-1284/test_2024-07-23/Makefile @@ -0,0 +1,124 @@ +.PHONY: all info flash picocom clean +$(shell mkdir -p dist >/dev/null) +$(shell mkdir -p build >/dev/null) +$(shell mkdir -p sim >/dev/null) +$(shell mkdir -p sim/build >/dev/null) + +NAME=test_2024-07-23_nano-1284p +SRC= $(wildcard src/*.c src/*.cpp src/*/*.c src/*/*.cpp) +HDR= $(wildcard src/*.h src/*.hpp src/*/*.h src/*/*.hpp) +OBJ_CPP = $(SRC:src/%.cpp=build/%.o) +OBJ = $(OBJ_CPP:src/%.c=build/%.o) +OBJ_SIM_CPP = $(SRC:src/%.cpp=sim/build/%.o) +OBJ_SIM = $(OBJ_SIM_CPP:src/%.c=sim/build/%.o) + +DEVICE=atmega1284p +AVRDUDE_DEVICE=m1284p + +CC= avr-g++ +CFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -c +LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -Wl,-u,vfprintf -lprintf_flt -lm + +CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -c -c +LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -Wl,-u,vfprintf -lprintf_flt -lm + + +all: dist/$(NAME).elf dist/$(NAME).s dist/$(NAME).hex sim/$(NAME).elf sim/$(NAME).s info + +info: + @avr-size --mcu=$(DEVICE) --format=avr dist/$(NAME).elf + +.depend: $(SRC) $(HDR) + $(CC) -mmcu=$(DEVICE) -MM $(SRC) | sed --regexp-extended 's/^(.*\.o)\: src\/(.*)(\.cpp|\.c) (.*)/build\/\2\.o\: src\/\2\3 \4/g' > .depend + +-include .depend + +# .depend solte auch auf Header Files achten! + +dist/$(NAME).elf: .depend $(OBJ) + $(CC) $(LFLAGS) -o $@ $(OBJ) + +dist/%.s: dist/%.elf + avr-objdump -d $< > $@ + +dist/%.hex: dist/%.elf + avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ + +sim/$(NAME).elf: .depend $(OBJ_SIM) + $(CC) $(LFLAGS_SIM) -o $@ $(OBJ_SIM) + +# ensure that __DATE__ and __TIME__ macros are up to date +build/main.o: src/main.cpp $(SRC) $(HDR) + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $< + +build/%.o: src/%.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $< + +build/%.o: src/%.cpp + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $< + +sim/build/%.o: src/%.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS_SIM) -o $@ $< + +sim/build/%.o: src/%.cpp + @mkdir -p $(dir $@) + $(CC) $(CFLAGS_SIM) -o $@ $< + +sim/%.s: sim/%.elf + avr-objdump -d $< > $@ + +simuc: sim/$(NAME).elf + simuc --board nano-1284 $< + +gdb: sim/$(NAME).elf + avr-gdb $< + + +flash: dist/$(NAME).elf all + avrdude -c arduino -P /dev/ttyUSB0 -p $(AVRDUDE_DEVICE) -e -U flash:w:$< + +flash0: dist/$(NAME).elf all + avrdude -c arduino -P /dev/ttyUSB0 -p $(AVRDUDE_DEVICE) -e -U flash:w:$< + +flash1: dist/$(NAME).elf all + avrdude -c arduino -P /dev/ttyUSB1 -p $(AVRDUDE_DEVICE) -e -U flash:w:$< + +flash2: dist/$(NAME).elf all + avrdude -c arduino -P /dev/ttyUSB2 -p $(AVRDUDE_DEVICE) -e -U flash:w:$< + +picocom: + # picocom sends CR for ENTER -> convert cr (\r) to lf (\n) + picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0 + +picocom0: + picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0 + +picocom1: + picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1 + +picocom2: + picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2 + + +isp-1284p: + avrdude -c usbasp -p $(AVRDUDE_DEVICE) + +isp-flash-1284p: dist/$(NAME).elf all + avrdude -c usbasp -p $(AVRDUDE_DEVICE) -e -U flash:w:$< + +flash-1284p: dist/$(NAME).elf all + avrdude -c arduino -p $(AVRDUDE_DEVICE) -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$< + +isp-fuse-1284p: + avrdude -c usbasp -p $(AVRDUDE_DEVICE) -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xFF:m -U lock:w:0xFF:m + +clean: + @rm -r dist + @rm -r build + @rm -r sim + @find . -type f -name ".depend" -exec rm {} \; + @echo "clean done" diff --git a/software/nano-1284/test_2024-07-23/README.md b/software/nano-1284/test_2024-07-23/README.md new file mode 100644 index 0000000..65a0866 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/README.md @@ -0,0 +1 @@ +# Testprogramm für Nano-1284 diff --git a/software/nano-1284/test_2024-07-23/src b/software/nano-1284/test_2024-07-23/src new file mode 120000 index 0000000..38a7ae1 --- /dev/null +++ b/software/nano-1284/test_2024-07-23/src @@ -0,0 +1 @@ +../../nano-644/test_2024-07-23/src \ No newline at end of file diff --git a/software/nano-644/test_2024-07-23/src/main.cpp b/software/nano-644/test_2024-07-23/src/main.cpp index 9c1aefd..dfbe397 100644 --- a/software/nano-644/test_2024-07-23/src/main.cpp +++ b/software/nano-644/test_2024-07-23/src/main.cpp @@ -25,9 +25,20 @@ #include "units/rtc8563.hpp" #include "units/cc1101.hpp" - const char MAIN_CPP_DATE[] PROGMEM = __DATE__; const char MAIN_CPP_TIME[] PROGMEM = __TIME__; +#ifdef __AVR_ATmega328P__ + const char MAIN_CPP_PART_NAME[] PROGMEM = "ATmega328P"; +#endif +#ifdef __AVR_ATmega644P__ + const char MAIN_CPP_PART_NAME[] PROGMEM = "ATmega644P"; +#endif +#ifdef __AVR_ATmega1284P__ + const char MAIN_CPP_PART_NAME[] PROGMEM = "ATmega1284P"; +#endif + +const char DIVIDER[] PROGMEM = "\n====================================\n "; +const char LINEFEED[] PROGMEM = "\n"; extern "C" { void __cxa_pure_virtual () {} @@ -81,7 +92,7 @@ extern "C" { static FILE mystdout = { 0, 0, _FDEV_SETUP_WRITE , 0, 0, uart_putchar, NULL, 0 }; static FILE mystdin = { 0, 0, _FDEV_SETUP_READ , 0, 0, NULL, uart_getchar, 0 }; - #ifdef __AVR_ATmega644P__ + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) static volatile uint16_t timerFlashGreenLed = 0; static volatile uint16_t timerFlashRedLed = 0; void flashRedLed (uint16_t ms) { @@ -156,7 +167,7 @@ int waitAndReadKey (uint32_t ms) { int main () { - #ifdef __AVR_ATmega644P__ + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 LEDs (Green, Orange, Red) DDRC |= (1 << DDC4) | (1 << DDC3) | (1 << DDC2); PORTC &= ~((1 << PORT4) | (1 << PORT3) | (1 << PORT2)); @@ -188,7 +199,7 @@ int main () { sei(); - #ifdef __AVR_ATmega644P__ + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) TestUnit *unit[] = { &led, &sw, &rgb, &seg7, &poti, &encoder, &r2r, &motor, &portExp, &lcd, &uart1, &modbus, &ieee485, &i2cMaster, &i2cSlave, &i2cSparkfun, &rtc8563, &cc1101Send, &cc1101Receive @@ -206,19 +217,19 @@ int main () { uint16_t i; char s[4]; do { - printf_P(PSTR("\n")); - printf_P(PSTR("\n=================================\n")); - printf_P(PSTR(" Version: ")); + printf_P(LINEFEED); + printf_P(DIVIDER); + printf_P(MAIN_CPP_PART_NAME); printf_P(PSTR(" / ")); printf_P(MAIN_CPP_DATE); printf_P(PSTR(" / ")); printf_P(MAIN_CPP_TIME); - printf_P(PSTR("\n=================================\n")); - printf_P(PSTR("\n")); + printf_P(DIVIDER); + printf_P(LINEFEED); printf_P(PSTR("Available units:\n\n")); for (i = 0; i < sizeof(unit) / sizeof(unit[0]); i++) { TestUnit *pu = unit[i]; printf_P(PSTR("%3x ... "), i); printf_P(pu->getName()); - printf_P(PSTR("\n")); + printf_P(LINEFEED); } printf_P(PSTR("\nSelect unit: ")); rIndex = 0; wIndex = 0; @@ -317,7 +328,7 @@ ISR (TIMER2_COMPA_vect) { // every 100us i2cSparkfun.tick1ms(); cc1101Send.tick1ms(); cc1101Receive.tick1ms(); - #ifdef __AVR_ATmega644P__ + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) if (timerFlashRedLed > 0) { if (--timerFlashRedLed < 128) { PORTC &= ~(1 << PC2); // red LED @@ -333,7 +344,7 @@ ISR (TIMER2_COMPA_vect) { // every 100us timer500ms++; if (timer500ms >= 5000) { - #ifdef __AVR_ATmega644P__ + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) PORTC ^= (1 << PC3); // orange LED blinking #endif #ifdef __AVR_ATmega328P__ diff --git a/software/nano-644/test_2024-07-23/src/main.hpp b/software/nano-644/test_2024-07-23/src/main.hpp index 11d7534..b10f038 100644 --- a/software/nano-644/test_2024-07-23/src/main.hpp +++ b/software/nano-644/test_2024-07-23/src/main.hpp @@ -12,7 +12,7 @@ extern int wait (uint32_t ms); extern int waitAndReadKey (uint32_t ms); extern uint64_t millis (); -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) extern "C" { extern void flashRedLed (uint16_t ms); extern void flashGreenLed (uint16_t ms); diff --git a/software/nano-644/test_2024-07-23/src/units/cc1101.cpp b/software/nano-644/test_2024-07-23/src/units/cc1101.cpp index 25a11de..d53ecf2 100644 --- a/software/nano-644/test_2024-07-23/src/units/cc1101.cpp +++ b/software/nano-644/test_2024-07-23/src/units/cc1101.cpp @@ -25,7 +25,7 @@ #endif -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // -------------------------------------------------------- @@ -324,7 +324,7 @@ PORTB &= ~(1 << PB0); DDRB |= ( 1 << PB0); - PRR &= (1 << PRSPI); + PRR0 &= (1 << PRSPI); // nCs PORTA |= (1 << PA4); diff --git a/software/nano-644/test_2024-07-23/src/units/encoder.cpp b/software/nano-644/test_2024-07-23/src/units/encoder.cpp index 975f358..7b33b76 100644 --- a/software/nano-644/test_2024-07-23/src/units/encoder.cpp +++ b/software/nano-644/test_2024-07-23/src/units/encoder.cpp @@ -14,7 +14,7 @@ // B --______----- // one step when: A = 0, B= 0->1 -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/ieee485.cpp b/software/nano-644/test_2024-07-23/src/units/ieee485.cpp index 3d0bfca..8fcb67a 100644 --- a/software/nano-644/test_2024-07-23/src/units/ieee485.cpp +++ b/software/nano-644/test_2024-07-23/src/units/ieee485.cpp @@ -21,7 +21,7 @@ int8_t Ieee485::run (uint8_t subtest) { #endif -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // ------------------------------------ diff --git a/software/nano-644/test_2024-07-23/src/units/lcd.cpp b/software/nano-644/test_2024-07-23/src/units/lcd.cpp index 3218842..8640690 100644 --- a/software/nano-644/test_2024-07-23/src/units/lcd.cpp +++ b/software/nano-644/test_2024-07-23/src/units/lcd.cpp @@ -5,7 +5,7 @@ #include "lcd.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/led.cpp b/software/nano-644/test_2024-07-23/src/units/led.cpp index c3175c1..5a56665 100644 --- a/software/nano-644/test_2024-07-23/src/units/led.cpp +++ b/software/nano-644/test_2024-07-23/src/units/led.cpp @@ -5,7 +5,7 @@ #include "led.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/modbus.cpp b/software/nano-644/test_2024-07-23/src/units/modbus.cpp index 9faf8db..abbe36d 100644 --- a/software/nano-644/test_2024-07-23/src/units/modbus.cpp +++ b/software/nano-644/test_2024-07-23/src/units/modbus.cpp @@ -13,7 +13,7 @@ int8_t Modbus::run (uint8_t subtest) { return -1; } void Modbus::handleRxByte (uint8_t b) {} #endif -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // PB0 ... nRE .. Read enable // PB1 ... DE .. Data enable diff --git a/software/nano-644/test_2024-07-23/src/units/motor.cpp b/software/nano-644/test_2024-07-23/src/units/motor.cpp index eac61bb..4457c1a 100644 --- a/software/nano-644/test_2024-07-23/src/units/motor.cpp +++ b/software/nano-644/test_2024-07-23/src/units/motor.cpp @@ -5,7 +5,7 @@ #include "motor.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/portexp.cpp b/software/nano-644/test_2024-07-23/src/units/portexp.cpp index 409d1f8..7eac74d 100644 --- a/software/nano-644/test_2024-07-23/src/units/portexp.cpp +++ b/software/nano-644/test_2024-07-23/src/units/portexp.cpp @@ -19,7 +19,7 @@ // GPA6 | IO16O1 (PA1) | L-Gelb | | GPB6 | IO16U1 (PC1) | O-Gelb | // GPA7 | IO16O0 (PA0) | L-Rot | | GPB7 | IO16U0 (PC0) | O-Rot | -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // -------------------------------------------------------- @@ -29,7 +29,7 @@ // PB7 ... SCK void PortExp::init () { - PRR &= (1 << PRSPI); + PRR0 &= (1 << PRSPI); PORTA |= (1 << PA7); DDRA |= (1 << PA7); // SPI nCS // PORTB/DDRB must be configured before SPCR !! diff --git a/software/nano-644/test_2024-07-23/src/units/r2r.cpp b/software/nano-644/test_2024-07-23/src/units/r2r.cpp index ef299ce..87fb822 100644 --- a/software/nano-644/test_2024-07-23/src/units/r2r.cpp +++ b/software/nano-644/test_2024-07-23/src/units/r2r.cpp @@ -4,7 +4,7 @@ #include "r2r.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // AVCC=3.3, POTI Vmax=3.3V #define K 1.0 #endif diff --git a/software/nano-644/test_2024-07-23/src/units/rgb.cpp b/software/nano-644/test_2024-07-23/src/units/rgb.cpp index c8d32c5..3f69cbd 100644 --- a/software/nano-644/test_2024-07-23/src/units/rgb.cpp +++ b/software/nano-644/test_2024-07-23/src/units/rgb.cpp @@ -4,7 +4,7 @@ #include "rgb.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/rtc8563.cpp b/software/nano-644/test_2024-07-23/src/units/rtc8563.cpp index 6baab35..9d26265 100644 --- a/software/nano-644/test_2024-07-23/src/units/rtc8563.cpp +++ b/software/nano-644/test_2024-07-23/src/units/rtc8563.cpp @@ -20,7 +20,7 @@ void Rtc8563::cleanup () {} int8_t Rtc8563::run (uint8_t subtest) { return -1; } #endif -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) void Rtc8563::init () { PORTC |= (1 << PC7); // nInt diff --git a/software/nano-644/test_2024-07-23/src/units/seg7.cpp b/software/nano-644/test_2024-07-23/src/units/seg7.cpp index d7d8c05..208107b 100644 --- a/software/nano-644/test_2024-07-23/src/units/seg7.cpp +++ b/software/nano-644/test_2024-07-23/src/units/seg7.cpp @@ -4,7 +4,7 @@ #include "seg7.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/switch.cpp b/software/nano-644/test_2024-07-23/src/units/switch.cpp index 45866a4..4ce9456 100644 --- a/software/nano-644/test_2024-07-23/src/units/switch.cpp +++ b/software/nano-644/test_2024-07-23/src/units/switch.cpp @@ -5,7 +5,7 @@ #include "switch.hpp" #include "../main.hpp" -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) // Nano-644 // --------------------------------------------------------------- diff --git a/software/nano-644/test_2024-07-23/src/units/uart1.cpp b/software/nano-644/test_2024-07-23/src/units/uart1.cpp index d813648..57e0bfb 100644 --- a/software/nano-644/test_2024-07-23/src/units/uart1.cpp +++ b/software/nano-644/test_2024-07-23/src/units/uart1.cpp @@ -12,7 +12,7 @@ void Uart1::handleRxByte (uint8_t b) {} #endif -#ifdef __AVR_ATmega644P__ +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) int uart1_putchar(char c, FILE *stream) { if (c == '\n') {