avr: more work on fan- and light controller app and modules.

This commit is contained in:
Martin Preuss
2026-08-07 23:45:21 +02:00
parent 296ead3241
commit f973ce1b14
9 changed files with 132 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
; ***************************************************************************
; copyright : (C) 2024 by Martin Preuss
; copyright : (C) 2026 by Martin Preuss
; email : martin@libchipcard.de
;
; ***************************************************************************
@@ -14,20 +14,33 @@
; ---------------------------------------------------------------------------
; @routine sk6812ReportState
; @routine AppLightControl_ReportState
;
; @param R18 state (0=off, 1=on)
; @clobbers R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, X
AppLightControl_ReportState:
ldi r17, VALUE_ID_LIGHTCONTROL_STATE
clr r19
ldi r20, 1
clr r21
ldi r22, AQHOME_VALUETYPE_ONOFF
push yl
push yh
rcall Main_SendValueReport ; (R16, R17, R18, R19, R20, R21, R23, R24, R25, X)
push zl
push zh
ldi zl, LOW(appLightControlObjectFlash*2)
ldi zh, HIGH(appLightControlObjectFlash*2)
lpm yl, Z+
lpm yh, Z
sbiw zh:zl, 1
ldd r16, Y+HTIM_RAM_OFFS_FLAGS
clr r18
sbrc r16, HTIM_FLAGBIT_STATE
inc r18
ldi r17, VALUE_ID_LIGHTCONTROL_STATE
clr r19
ldi r20, 1
clr r21
ldi r22, AQHOME_VALUETYPE_ONOFF
rcall Main_SendValueReport ; (R16, R17, R18, R19, R20, R21, R23, R24, R25, X)
pop zh
pop zl
pop yh
pop yl
ret