more work on switching to new COM and TIMER stack.

This commit is contained in:
Martin Preuss
2023-04-13 21:16:51 +02:00
parent a61226c3d9
commit c00b90bf28
9 changed files with 168 additions and 64 deletions

View File

@@ -441,6 +441,54 @@ si7021Muls16x16_32_done:
; ret
SI7021_SendTemp:
lds r16, si7021Flags
andi r16, SI7021_FLAGS_TEMP_VALID
brne SI7021_SendTemp_haveValue
sec
ret
SI7021_SendTemp_haveValue:
ldi r16, 0xff ; destination address
ldi r17, VALUE_ID_TEMP1 ; value id
ldi r22, AQHOME_VALUETYPE_TEMP
lds r18, si7021LastTemp ; value
lds r19, si7021LastTemp+1
ldi r20, 100 ; denominator
clr r21
rjmp SI7021_SendValue
SI7021_SendHumidity:
lds r16, si7021Flags
andi r16, SI7021_FLAGS_HUM_VALID
brne SI7021_SendHumidity_haveValue
clc
ret
SI7021_SendHumidity_haveValue:
ldi r16, 0xff ; destination address
ldi r17, VALUE_ID_HUM1 ; value id
ldi r22, AQHOME_VALUETYPE_HUMIDITY
lds r18, si7021LastHumidity ; value
lds r19, si7021LastHumidity+1
ldi r20, 1 ; denominator
clr r21
rjmp SI7021_SendValue
SI7021_SendValue:
ldi xl, LOW(com2SendBuffer)
ldi xh, HIGH(com2SendBuffer)
rcall CPRO_WriteValue
rjmp COM2_SendPacket
SI7021_END:
.equ MODULE_SIZE_SI7021 = SI7021_END-SI7021_BEGIN