avr: added timer entry for every5s

This will be used for the window check module.
This commit is contained in:
Martin Preuss
2023-04-08 03:09:12 +02:00
parent 2a53ad9ede
commit a7928e0dbf
3 changed files with 29 additions and 50 deletions

View File

@@ -110,44 +110,6 @@
; ---------------------------------------------------------------------------
; TWI master module
.equ TWI_DDR_SCL = DDRA
.equ TWI_PORT_SCL = PORTA
.equ TWI_PIN_SCL = PINA
.equ TWI_PINNUM_SCL = PORTA4
.equ TWI_DDR_SDA = DDRA
.equ TWI_PORT_SDA = PORTA
.equ TWI_PIN_SDA = PINA
.equ TWI_PINNUM_SDA = PORTA6
; ---------------------------------------------------------------------------
; LCD module
.equ LCD_TWI_ADDRESS = 0x3c
; ---------------------------------------------------------------------------
; BMP 280
.equ BMP280_ADDR = 0x76
; ---------------------------------------------------------------------------
; SI 7021
.equ SI7021_ADDR = 0x40
; *************************************************************************** ; ***************************************************************************
; code segment ; code segment
@@ -260,6 +222,14 @@ onEverySecond:
; ---------------------------------------------------------------------------
; Called every 5 seconds. Add your routine calls here. No arguments, no results.
onEvery5s:
ret
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; Called every 10 seconds. Add your routine calls here. No arguments, no results. ; Called every 10 seconds. Add your routine calls here. No arguments, no results.

View File

@@ -11,8 +11,8 @@
; VCC 1 14 GND ; VCC 1 14 GND
; PB0 2 13 PA0 ; PB0 2 13 PA0
; PB1 3 12 PA1 COM-DATA ; PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2 OWI ; /RESET PB3 4 11 PA2 [OWI]
; KEY1 PB2 5 10 PA3 LED ; [KEY1] PB2 5 10 PA3 LED
; COM_ATTN PA7 6 9 PA4 TWI-SCL ; COM_ATTN PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5 ; TWI-SDA PA6 7 8 PA5
; -------- ; --------
@@ -295,6 +295,14 @@ onEverySecond:
; ---------------------------------------------------------------------------
; Called every 5 seconds. Add your routine calls here. No arguments, no results.
onEvery5s:
ret
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; Called every 10 seconds. Add your routine calls here. No arguments, no results. ; Called every 10 seconds. Add your routine calls here. No arguments, no results.

View File

@@ -19,7 +19,7 @@ timerModuleTickCounter: .byte 1
timerModuleFlags: .byte 1 timerModuleFlags: .byte 1
timerModuleCounterSecs: .byte 4 timerModuleCounterSecs: .byte 4
timerModuleDerivedCounters: .byte 9 ; must correspond to entries in timer table! timerModuleDerivedCounters: .byte 10 ; must correspond to entries in timer table!
timerModuleData_end: timerModuleData_end:
@@ -34,15 +34,16 @@ timerModuleData_end:
; number of entries here must be equal to bytes in timerModuleDerivedCounters! ; number of entries here must be equal to bytes in timerModuleDerivedCounters!
timerTable: timerTable:
.db 10, 0, LOW(onEvery10s), HIGH(onEvery10s) ; 10s: overflow after 10*1s (1) .db 5, 0, LOW(onEvery5s), HIGH(onEvery5s) ; 5s : overflow after 5*1s (1)
.db 3, 0, LOW(onEvery30s), HIGH(onEvery30s) ; 30s: overflow after 3*10s (2) .db 2, 0, LOW(onEvery10s), HIGH(onEvery10s) ; 10s: overflow after 2*5s (2)
.db 2, 0, LOW(onEvery1m), HIGH(onEvery1m) ; 1m : overflow after 2*30s (3) .db 3, 0, LOW(onEvery30s), HIGH(onEvery30s) ; 30s: overflow after 3*10s (3)
.db 5, 0, LOW(onEvery5m), HIGH(onEvery5m) ; 5m : overflow after 5*1m (4) .db 2, 0, LOW(onEvery1m), HIGH(onEvery1m) ; 1m : overflow after 2*30s (4)
.db 3, 0, LOW(onEvery15m), HIGH(onEvery15m) ; 15m: overflow after 3*5m (5) .db 5, 0, LOW(onEvery5m), HIGH(onEvery5m) ; 5m : overflow after 5*1m (5)
.db 2, 0, LOW(onEvery30m), HIGH(onEvery30m) ; 30m: overflow after 2*15m (6) .db 3, 0, LOW(onEvery15m), HIGH(onEvery15m) ; 15m: overflow after 3*5m (6)
.db 2, 0, LOW(onEvery1h), HIGH(onEvery1h) ; 1h: overflow after 2*30m (7) .db 2, 0, LOW(onEvery30m), HIGH(onEvery30m) ; 30m: overflow after 2*15m (7)
.db 12, 0, LOW(onEvery12h), HIGH(onEvery12h) ; 12h: overflow after 12*1h (8) .db 2, 0, LOW(onEvery1h), HIGH(onEvery1h) ; 1h: overflow after 2*30m (8)
.db 2, 0, LOW(onEvery1d), HIGH(onEvery1d) ; 1d: overflow after 2*12h (9) .db 12, 0, LOW(onEvery12h), HIGH(onEvery12h) ; 12h: overflow after 12*1h (9)
.db 2, 0, LOW(onEvery1d), HIGH(onEvery1d) ; 1d: overflow after 2*12h (10)
.db 0, 0 .db 0, 0