Call UID generator (if necessary).

This commit is contained in:
Martin Preuss
2023-02-04 16:02:18 +01:00
parent 910bb78e52
commit f58f301423

View File

@@ -55,6 +55,14 @@
; ---------------------------------------------------------------------------
; EEPROM positions
.equ EEPROM_OFFS_UUID = 0 ; 4 bytes (occupy total of 8 bytes for extensibility)
.equ EEPROM_OFFS_COMADDR = 8 ; 1 byte
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; COM module ; COM module
@@ -80,8 +88,6 @@
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; TWI master module ; TWI master module
.equ LCD_TWI_ADDRESS = 0x3c
.equ TWI_DDR_SCL = DDRA .equ TWI_DDR_SCL = DDRA
.equ TWI_PORT_SCL = PORTA .equ TWI_PORT_SCL = PORTA
.equ TWI_PIN_SCL = PINA .equ TWI_PIN_SCL = PINA
@@ -94,6 +100,13 @@
; ---------------------------------------------------------------------------
; LCD module
.equ LCD_TWI_ADDRESS = 0x3c
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; BMP 280 ; BMP 280
@@ -139,11 +152,34 @@
reti ; USI_STR reti ; USI_STR
reti ; USI_OVF reti ; USI_OVF
.org 0x40
; ---------------------------------------------------------------------------
; Node Id (not overwritten when updating system)
nodeUid: .db 0, 0, 0, 0, 0, 0, 0, 0
; ---------------------------------------------------------------------------
; maintenance system starts here.
.org 0x50
realInterruptTable:
rjmp main ; Reset vector
reti ; EXT_INT0
rjmp comIsrPcint0 ; PCI0
reti ; PCI1
reti ; WATCHDOG
reti ; ICP1
reti ; OC1A
reti ; OC1B
reti ; OVF1
rjmp timerIrqOC0A ; OC0A
reti ; OC0B
reti ; OVF0
reti ; ACI
reti ; ADCC
reti ; ERDY
reti ; USI_STR
reti ; USI_OVF
; *************************************************************************** ; ***************************************************************************
@@ -189,11 +225,36 @@ blinkPattern: .db 5, 5, 5, 5, 5, 10, 0xff, 0xff ; 3 short blinks, 1s pause, r
blinkPattern2: .db 10, 20, 0xff, 0xff ; 1 long blink, 2s pause, restart blinkPattern2: .db 10, 20, 0xff, 0xff ; 1 long blink, 2s pause, restart
.include "main.asm" .include "main.asm"
; ---------------------------------------------------------------------------
; onSystemStart
;
; Called on first time run, i.e. on system start.
;
; IN:
; - nothing
; OUT:
; - nothing
; USED: depending on called routines
onSystemStart:
#ifdef MODULES_COM
rcall Utils_SetupUid
; brcc onSystemStart_l1
ldi r16, 0xff
rcall CPRO_EnqueueNeedAddress
onSystemStart_l1:
#endif
ret
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; onEvery100ms ; onEvery100ms
; ;
@@ -271,6 +332,8 @@ onEvery30s:
rcall SI7021_PeriodicMeasurement rcall SI7021_PeriodicMeasurement
rcall sendValueMsg rcall sendValueMsg
#endif #endif
; rcall Utils_SetupUid ; debug
ret ret