avr: fully implemented app light_control.

This commit is contained in:
Martin Preuss
2026-08-07 00:43:42 +02:00
parent 7bae2072aa
commit f3820aee22
9 changed files with 73 additions and 33 deletions

View File

@@ -44,6 +44,11 @@ appsOnEvery100ms:
bigcall AppFanControl_OnEveryTick
#endif
#ifdef APPS_LIGHTCONTROL
bigcall AppLightControl_OnEveryTick
#endif
ret
; @end

View File

@@ -71,11 +71,13 @@ APP_END_NETWORK:
#endif
#ifdef APPS_REPORTSENSORS
.include "common/walktable.asm"
.include "apps/reportsensors/data.asm"
.include "apps/reportsensors/main.asm"
#endif
#ifdef APPS_STATS
;.include "common/walktable.asm"
.include "apps/stats/data.asm"
.include "apps/stats/main.asm"
.include "apps/network/stats.asm"
@@ -107,6 +109,25 @@ APP_END_NETWORK:
#endif
#ifdef APPS_LIGHTCONTROL
.include "modules/holdtimer/defs.asm"
.include "modules/holdtimer/main.asm"
.include "modules/triggeractor/defs.asm"
.include "modules/triggeractor/main.asm"
.include "modules/triggeractor/recv.asm"
.include "apps/light_control/defs.asm"
.include "apps/light_control/main.asm"
#ifdef MODULES_NETWORK
.include "devices/all/handlevaluemsg.asm"
.include "apps/light_control/recv.asm"
.include "apps/light_control/send.asm"
#endif
#endif
#endif

View File

@@ -71,6 +71,11 @@ appsInit:
bigcall AppFanControl_Init
#endif
#ifdef APPS_LIGHTCONTROL
bigcall AppLightControl_Init
#endif
; done
ret
; @end

View File

@@ -41,6 +41,11 @@ appsOnPacketReceived:
bigcall AppFanControl_OnPacketReceived
#endif
#ifdef APPS_LIGHTCONTROL
bigcall AppLightControl_OnPacketReceived
#endif
; add more here
ret

View File

@@ -106,10 +106,6 @@ modulesOnEvery100ms:
bigcall XPT2046_Every100ms
#endif
#ifdef MODULES_SK6812
bigcall SK6812_Every100ms
#endif
ret
; @end

View File

@@ -273,14 +273,7 @@ MODULE_END_COM2W2:
#ifdef MODULES_SK6812
.include "modules/sk6812/main.asm"
.include "modules/sk6812/io.asm"
.include "modules/sk6812/io0.asm"
.include "modules/sk6812/io1.asm"
#ifdef MODULES_NETWORK
.include "modules/sk6812/recv.asm"
.include "modules/sk6812/send.asm"
.include "devices/all/handlevaluemsg.asm"
#endif
#endif
#ifdef MODULES_LCD

View File

@@ -19,10 +19,6 @@
modulesOnPacketReceived:
#ifdef MODULES_SK6812
bigcall SK6812_OnPacketReceived
#endif
#ifdef MODULES_DS3231
#ifdef MODULES_NETWORK
bigcall Ds3231_OnPacketReceived

View File

@@ -56,34 +56,31 @@
#define MODULES_NETWORK
#define MODULES_COM2W
#define MODULES_OWI_MASTER
#define MODULES_DS18B20
;#define MODULES_DS18B20
#define MODULES_SK6812
#define APPS_NETWORK
#define APPS_REPORTSENSORS
;#define APPS_REPORTSENSORS
#define APPS_STATS
#define APPS_MA_LIGHT
#define APPS_LIGHTCONTROL
; ---------------------------------------------------------------------------
; defines for modules
.equ VALUE_ID_DS18B20_TEMP = 0x06
.equ VALUE_ID_MAL_STATE = 0x07
.equ VALUE_ID_LED_STATE = 0x81
.equ VALUE_ID_LED_NUMLEDS = 0x82
.equ VALUE_ID_LED_RGBW_VALUE = 0x83
.equ VALUE_ID_MAL_RGBW_VALUE = 0x84
.equ VALUE_ID_MAL_ONTIME = 0x85
.equ VALUE_ID_MAL_SOURCE1 = 0x86
.equ VALUE_ID_MAL_SOURCE2 = 0x87
.equ VALUE_ID_MAL_BSOURCE = 0x89
.equ VALUE_ID_MAL_BVALUE = 0x8a
.equ VALUE_ID_LED_MODE = 0x8b
.equ VALUE_ID_LED_TYPE = 0x8c
.equ VALUE_ID_DS18B20_TEMP = 0x06
.equ VALUE_ID_LIGHTCONTROL_STATE = 0x07
.equ VALUE_ID_LIGHTCTRL_NUMLEDS = 0x82
.equ VALUE_ID_LIGHTCTRL_VALUE = 0x84
.equ VALUE_ID_LIGHTCTRL_HOLDTIME = 0x85
.equ VALUE_ID_LIGHTCTRL_TRIGGER1SRC = 0x86
.equ VALUE_ID_LIGHTCTRL_TRIGGER2SRC = 0x87
.equ VALUE_ID_LIGHTCTRL_GUARDSRC = 0x89
.equ VALUE_ID_LIGHTCTRL_MODE = 0x8b
.equ VALUE_ID_LIGHTCTRL_GUARDLIM = 0x8c
.equ VALUE_ID_LIGHTCTRL_TRIGGER1LIM = 0x8d
.equ VALUE_ID_LIGHTCTRL_TRIGGER2LIM = 0x8e
@@ -186,6 +183,8 @@ onEveryLoop:
.include "devices/all/hw_tn84.asm"
.include "devices/all/includes.asm"
;.include "common/debug.asm"
.include "common/eeprom_tlv.asm"
.include "common/walktable.asm"

View File

@@ -19,6 +19,26 @@
<value name="MALSOURCEB" id="0x89" type="actor" dataType="uint16" />
<value name="MALVALUEB" id="0x8a" type="actor" dataType="uint16" />
<value name="MALSTATE" id="0x07" type="sensor" dataType="uint16" modality="onOff" />
<value name="LIGHTCTL_STATE" id="0x07" type="sensor" dataType="uint16" modality="onOff" />
<value name="LIGHTCTL_GUARD_SOURCE" id="0x89" type="actor" dataType="uint16" denom="1" />
<value name="LIGHTCTL_GUARD_LIMITS" id="0x8c" type="actor" dataType="uint32" denom="1" />
<value name="LIGHTCTL_TRIGGER1_SOURCE" id="0x86" type="actor" dataType="uint16" denom="1" />
<value name="LIGHTCTL_TRIGGER1_LIMITS" id="0x8d" type="actor" dataType="uint32" denom="1" />
<value name="LIGHTCTL_TRIGGER2_SOURCE" id="0x87" type="actor" dataType="uint16" denom="1" />
<value name="LIGHTCTL_TRIGGER2_LIMITS" id="0x8e" type="actor" dataType="uint32" denom="1" />
<value name="LIGHTCTL_VALUE" id="0x84" type="actor" dataType="dword" modality="rgbw" denom="1" />
<value name="LIGHTCTL_NUMLEDS" id="0x82" type="actor" dataType="uint16" denom="1" />
<value name="LIGHTCTL_HOLDTIME" id="0x85" type="actor" dataType="uint16" denom="1" />
<value name="LIGHTCTL_MODE" id="0x8b" type="actor" dataType="int" modality="onOffAuto" denom="1" />
</values>
</device>