avr: more code sharing.

This commit is contained in:
Martin Preuss
2026-04-14 23:45:32 +02:00
parent d6e731b34e
commit ab7e28a9d5
6 changed files with 306 additions and 459 deletions

View File

@@ -20,6 +20,9 @@
.include "devices/all/data.asm"
.include "common/utils.asm"
.include "common/random.asm"
.include "common/eeprom-r.asm"
.include "common/eeprom-w.asm"
.include "common/utils_initial_wait.asm"
.include "common/utils_wait_fixed.asm"
.include "common/utils_copy_from_flash.asm"

View File

@@ -34,7 +34,7 @@ main:
bigcall systemSetSpeed
bigcall systemInitHardware
bigcall Utils_Init
bigcall RAND_SetupSeed
bigcall Utils_SetupUid
bigcall modulesInit
bigcall appsInit
@@ -43,16 +43,6 @@ main:
bigcall onSystemStart
#ifdef MODULES_LED
ldi xl, LOW(blinkPattern) ; debug: set blink pattern
ldi xh, HIGH(blinkPattern)
ldi zl, LOW(ledA3Flash)
ldi zh, HIGH(ledA3Flash)
ldi yl, LOW(ledA3Sram)
ldi yh, HIGH(ledA3Sram)
rcall Led_SetPattern
#endif
main_loop:
bigcall systemSleep ; system-dependant

View File

@@ -28,6 +28,7 @@
#endif
#ifdef MODULES_NETWORK
MODULE_BEGIN_NETWORK:
.include "common/crc8.asm"
.include "common/m_fixedbuffers.asm"
.include "common/m_ringbuffer_y.asm"
@@ -44,6 +45,9 @@
.include "modules/network/msg/value-r.asm"
.include "modules/network/msg/addr-r.asm"
.include "modules/network/msg/addr-w.asm"
MODULE_END_NETWORK:
.equ MODULE_SIZE_NETWORK = MODULE_END_NETWORK-MODULE_BEGIN_NETWORK
#endif
#ifdef MODULES_UART_BITBANG
@@ -89,8 +93,11 @@
#endif
#ifdef MODULES_COM2W
MODULE_BEGIN_COM2W:
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2w.asm"
MODULE_END_COM2W:
.equ MODULE_SIZE_COM2W = MODULE_END_COM2W-MODULE_BEGIN_COM2W
#endif
#ifdef MODULES_COM2W0
@@ -139,9 +146,6 @@
#ifdef MODULES_LED_SIMPLE
.include "modules/led_simple/main.asm"
#ifdef MODULES_NETWORK
.include "modules/led_simple/recv.asm"
#endif
#endif
#ifdef MODULES_LED_SIGNAL