introduce macros bigjmp and bigcall for intermodule calls/jmps

translates to rjmp/rcall on MCUs with up to 8K flash and to jmp/call
on others.
This commit is contained in:
Martin Preuss
2025-06-01 19:18:25 +02:00
parent 188e7da379
commit bb14dd4c22
11 changed files with 128 additions and 96 deletions

View File

@@ -22,22 +22,22 @@
; Call init functions of the used modules. Add your routine calls here.
initModules:
rcall BaseTimer_Init ; unconditionally call this
bigcall BaseTimer_Init ; unconditionally call this
#ifdef MODULES_HEAP
rcall Heap_Init
bigcall Heap_Init
#endif
#ifdef MODULES_CLOCK
rcall Clock_Init
bigcall Clock_Init
#endif
#ifdef MODULES_TIMER
rcall Timer_Init
bigcall Timer_Init
#endif
#ifdef MODULES_XRAM
rcall XRAM_Init
bigcall XRAM_Init
#endif
#ifdef MODULES_LED
@@ -45,107 +45,107 @@ initModules:
ldi zh, HIGH(ledA3Flash)
ldi yl, LOW(ledA3Sram)
ldi yh, HIGH(ledA3Sram)
rcall Led_Init
bigcall Led_Init
#endif
#ifdef MODULES_LED_SIMPLE
rcall LedSimple_Init
bigcall LedSimple_Init
#endif
#ifdef MODULES_COM
rcall Com2_Init ; init COM module
rcall CPRO_Init ; init COM protocol module
bigcall Com2_Init ; init COM module
bigcall CPRO_Init ; init COM protocol module
#endif
#ifdef MODULES_NETWORK
rcall NET_Init
bigcall NET_Init
#endif
#ifdef MODULES_UART_BITBANG
rcall UART_BitBang_Init
bigcall UART_BitBang_Init
#endif
#ifdef MODULES_UART_HW
rcall NET_Uart_Init
bigcall NET_Uart_Init
#endif
#ifdef MODULES_TTYONUART1
rcall TtyOnUart1_Init
bigcall TtyOnUart1_Init
#endif
#ifdef MODULES_COMONUART0
rcall ComOnUart0_Init
bigcall ComOnUart0_Init
#endif
#ifdef MODULES_MOTION
rcall Motion_Init
bigcall Motion_Init
#endif
#ifdef MODULES_TWI_MASTER
rcall TWI_Master_Init
bigcall TWI_Master_Init
#endif
#ifdef MODULES_OWI_MASTER
rcall OwiMaster_Init
bigcall OwiMaster_Init
#endif
#ifdef MODULES_SPI_HW
rcall SPIHW_Init
bigcall SPIHW_Init
#endif
#ifdef MODULES_LCD
rcall LCD_Init
bigcall LCD_Init
#endif
#ifdef MODULES_BMP280
rcall BMP280_Init
bigcall BMP280_Init
#endif
#ifdef MODULES_SI7021
rcall SI7021_Init
bigcall SI7021_Init
#endif
#ifdef MODULES_SGP30
rcall SGP30_Init
bigcall SGP30_Init
#endif
#ifdef MODULES_SGP40
rcall SGP40_Init
bigcall SGP40_Init
#endif
#ifdef MODULES_DS18B20
rcall Ds18b20_Init
bigcall Ds18b20_Init
#endif
#ifdef MODULES_STATS
rcall Stats_Init
bigcall Stats_Init
#endif
#ifdef MODULES_CNY70
rcall CNY70_Init
bigcall CNY70_Init
#endif
#ifdef MODULES_REED
rcall REED_Init
bigcall REED_Init
#endif
#ifdef MODULES_SK6812
rcall SK6812_Init
bigcall SK6812_Init
#endif
#ifdef MODULES_MOTION_LIGHT
rcall MotionLight_Init
bigcall MotionLight_Init
#endif
#ifdef MODULES_TCRT1000
rcall TCRT1K_Init
bigcall TCRT1K_Init
#endif
#ifdef MODULES_CCS811
rcall CCS811_Init
bigcall CCS811_Init
#endif
#ifdef MODULES_ILI9341
rcall ILI9341_Init
bigcall ILI9341_Init
#endif
@@ -167,14 +167,14 @@ initModules:
; USED: depending on called routines
runModules:
rcall BaseTimer_Run
bigcall BaseTimer_Run
#ifdef MODULES_COM
; COM module (call until carry flag cleared but at most 10 times to not starve other modules)
ldi r16, 10
runModules_Com:
push r16
rcall Com2_Run
bigcall Com2_Run
pop r16
brcc runModules_ComEnd
dec r16
@@ -183,23 +183,23 @@ runModules_ComEnd:
#endif
#ifdef MODULES_TTYONUART1
rcall TtyOnUart1_Run
bigcall TtyOnUart1_Run
#endif
#ifdef MODULES_COMONUART0
rcall ComOnUart0_Run
bigcall ComOnUart0_Run
#endif
#ifdef MODULES_STATS
rcall Stats_Run
bigcall Stats_Run
#endif
#ifdef MODULES_REED
rcall REED_Run
bigcall REED_Run
#endif
#ifdef MODULES_CNY70
rcall CNY70_Run
bigcall CNY70_Run
#endif
#ifdef MODULES_MOTION_LIGHT
@@ -220,12 +220,12 @@ runModules_ComEnd:
mainModulesOnPacketReceived:
#ifdef MODULES_SK6812
rcall SK6812_OnPacketReceived
bigcall SK6812_OnPacketReceived
#endif
#ifdef MODULES_LED_SIMPLE
#ifdef MODULES_NETWORK
rcall LedSimple_OnPacketReceived
bigcall LedSimple_OnPacketReceived
#endif
#endif