avr: started adding COM2WN module.

This commit is contained in:
Martin Preuss
2025-08-04 22:28:49 +02:00
parent 32bd3bc2f9
commit 0dc4a3a952
4 changed files with 36 additions and 5 deletions

View File

@@ -119,6 +119,20 @@
#endif
#ifdef MODULES_COM2WN
.include "modules/com2w/defs.asm"
.include "modules/com2w/com2wn_init.asm"
.include "modules/com2w/com2wn_io.asm"
.include "modules/com2w/com2wn_irq.asm"
.include "modules/com2w/com2wn_recv.asm"
.include "modules/com2w/com2wn_run.asm"
.include "modules/com2w/com2wn_send.asm"
.include "modules/com2w/com2wn_wait.asm"
.include "modules/com2w/com2wn_data.asm"
#endif
#ifdef MODULES_CLOCK
.include "modules/clock/main.asm"
#endif

View File

@@ -148,6 +148,11 @@ onSystemTimerTick:
bigcall COM2W1_Periodically
#endif
#ifdef MODULES_COM2WN
bigcall COM2WN_Periodically
#endif
#ifdef MODULES_TCRT1000
bigcall TCRT1K_Every100ms
#endif

View File

@@ -93,6 +93,11 @@ initModules:
bigcall COM2W1_Init
#endif
#ifdef MODULES_COM2WN
bigcall COM2WN_Init
#endif
#ifdef MODULES_MOTION
bigcall Motion_Init
#endif
@@ -250,6 +255,13 @@ runComModules_loop:
sbci r16, 0
#endif
#ifdef MODULES_COM2WN
push r16
bigcall COM2WN_Run
pop r16
sbci r16, 0
#endif
pop r17
; check for repeat request
tst r16

View File

@@ -47,7 +47,8 @@
; ---------------------------------------------------------------------------
; generic
.equ NET_BUFFERS_NUM = 6
.equ NET_BUFFERS_NUM = 6
.equ COM2WN_IO_RINGBUFFER_SIZE = 128
.equ PROGRAM_SENSOR_INTERVAL_SECS = 60
.equ PROGRAM_STATS_INTERVAL_MINS = 10
@@ -62,7 +63,7 @@
#define MODULES_LED_SIMPLE
#define MODULES_NETWORK
;#define MODULES_UART_BITBANG
#define MODULES_COM2WG
#define MODULES_COM2WN
;#define MODULES_TWI_MASTER
;#define MODULES_LCD
;#define LCD_MINIMAL_FONT
@@ -122,10 +123,9 @@
; Reset and interrupt vectors (will be removed as soon as we can flash data over COM)
; rjmp main ; Reset vector
rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system
rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system
reti ; EXT_INT0
; rjmp UART_BitBang_PcintIsr ; PCI0
rjmp com2wPcintIsr ; PCI0
rjmp COM2WN_ClkChangeIsr ; PCI0
reti ; PCI1
reti ; WATCHDOG
reti ; ICP1