n14, n25, n30: use new app LightControl instead of old app MA_Light

This commit is contained in:
Martin Preuss
2026-08-10 19:50:29 +02:00
parent b9f2d9e59a
commit c67fa6ebc9
9 changed files with 77 additions and 161 deletions

View File

@@ -87,3 +87,10 @@
; ---------------------------------------------------------------------------
; EEPROM TLV ids
.equ APP_LIGHTCONTROL_EEID = 0x31

View File

@@ -61,7 +61,7 @@
#define APPS_NETWORK
#define APPS_REPORTSENSORS
#define APPS_STATS
#define APPS_MA_LIGHT
#define APPS_LIGHTCONTROL
@@ -69,20 +69,18 @@
; defines for modules
.equ VALUE_ID_DS18B20_TEMP = 0x06
.equ VALUE_ID_MAL_STATE = 0x07
;.equ VALUE_ID_REED_CONF = 0x81
.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_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
@@ -195,7 +193,8 @@ onEveryLoop:
.include "devices/all/hw_tn85.asm"
.include "devices/all/includes.asm"
.include "common/debug.asm"
;.include "common/debug.asm"
.include "common/eeprom_tlv.asm"

View File

@@ -99,3 +99,9 @@
.equ SK6812_PINNUM = PORTA6
; ---------------------------------------------------------------------------
; EEPROM TLV ids
.equ APP_LIGHTCONTROL_EEID = 0x31

View File

@@ -62,37 +62,26 @@
#define APPS_NETWORK
#define APPS_REPORTSENSORS
#define APPS_STATS
#define APPS_MA_LIGHT
#define APPS_LIGHTCONTROL
; ---------------------------------------------------------------------------
; defines for modules
;.equ VALUE_ID_SI7021_TEMP = 0x01
;.equ VALUE_ID_SI7021_HUM = 0x02
;.equ VALUE_ID_ADC = 0x03
;.equ VALUE_ID_REED1 = 0x04
;.equ VALUE_ID_REED2 = 0x05
.equ VALUE_ID_DS18B20_TEMP = 0x06
.equ VALUE_ID_MAL_STATE = 0x07
;.equ VALUE_ID_REED_CONF = 0x81
.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_LEDSIMPLE_TIMING = 0x88
.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
@@ -142,63 +131,16 @@ firmwareStart:
; ---------------------------------------------------------------------------
; @routine onSystemStart
onSystemStart:
ret
; @end
; ---------------------------------------------------------------------------
; @routine onMessageReceived
;
; Called on every message received
onMessageReceived:
clc
ret
; @end
; ---------------------------------------------------------------------------
; @routine onEvery100ms
;
; Called every 100ms. Add your routine calls here. No arguments, no results.
onEvery100ms:
onEverySecond:
onEveryMinute:
onEveryHour:
onEveryDay:
ret
; @end
onEverySecond:
ret
#if 0
; debug
ldi r19, 0x00 ; G
ldi r18, 0xff ; R
ldi r20, 0x55 ; B
ldi r21, 0xaa ; W
rcall SK6812_SetAllColor ; r23 (r16, r17)
#endif
ret
; ---------------------------------------------------------------------------
; @routine onEveryLoop
;
; Called on every loop (i.e. after awakening from sleep).
;
onEveryLoop:
clc
ret
; @end
@@ -207,6 +149,7 @@ onEveryLoop:
.include "devices/all/hw_tn84.asm"
.include "devices/all/includes.asm"
.include "common/eeprom_tlv.asm"
;.include "common/debug.asm"

View File

@@ -99,6 +99,7 @@
.equ SK6812_PINNUM = PORTA6
; ---------------------------------------------------------------------------
; EEPROM TLV ids
.equ APP_LIGHTCONTROL_EEID = 0x31

View File

@@ -130,48 +130,15 @@ firmwareStart:
; ---------------------------------------------------------------------------
; @routine onSystemStart
onSystemStart:
ret
; @end
; ---------------------------------------------------------------------------
; @routine onMessageReceived
;
; Called on every message received
onMessageReceived:
clc
ret
; @end
; ---------------------------------------------------------------------------
; @routine onEvery100ms
;
; Called every 100ms. Add your routine calls here. No arguments, no results.
onEvery100ms:
onEveryHour:
onEveryDay:
onEveryMinute:
onEverySecond:
ret
; @end
; ---------------------------------------------------------------------------
; @routine onEveryLoop
;
; Called on every loop (i.e. after awakening from sleep).
;
onEveryLoop:
clc
ret
; @end
@@ -196,7 +163,7 @@ onEveryLoop:
deviceCodeEnd:
.if deviceCodeEnd >= BOOTLOADER_ADDR
.if deviceCodeEnd > BOOTLOADER_ADDR
.warning "Code reaches into boot loader!"
.endif

View File

@@ -7,20 +7,23 @@
<values>
<value name="DS18B20_TEMP" id="0x06" type="sensor" dataType="rational" modality="temperature" units="C" denom="16" />
<value name="RGBWSTATE" id="0x81" type="actor" dataType="uint16" modality="onOff"/>
<value name="NUMLEDS" id="0x82" type="actor" dataType="int" />
<value name="RGBWVALUE" id="0x83" type="actor" dataType="dword" modality="rgbw"/>
<value name="RGBWMODE" id="0x8b" type="actor" dataType="int" modality="onOffAuto" />
<value name="RGBWTYPE" id="0x8c" type="actor" dataType="int" />
<value name="LIGHTCTL_STATE" id="0x07" type="sensor" dataType="uint16" modality="onOff" />
<value name="MALONTIME" id="0x85" type="actor" dataType="uint16" />
<value name="MALSOURCE1" id="0x86" type="actor" dataType="uint16" />
<value name="MALSOURCE2" id="0x87" type="actor" dataType="uint16" />
<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_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" />
<value name="LEDTIMING" id="0x88" type="actor" dataType="uint16" />
</values>
</device>

View File

@@ -7,20 +7,24 @@
<values>
<value name="DS18B20_TEMP" id="0x06" type="sensor" dataType="rational" modality="temperature" units="C" denom="16" />
<value name="RGBWSTATE" id="0x81" type="actor" dataType="uint16" modality="onOff" />
<value name="NUMLEDS" id="0x82" type="actor" dataType="int" />
<value name="RGBWVALUE" id="0x83" type="actor" dataType="dword" modality="rgbw"/>
<value name="RGBWMODE" id="0x8b" type="actor" dataType="int" modality="onOffAuto" />
<value name="RGBWTYPE" id="0x8c" type="actor" dataType="int" />
<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" />
<value name="MALONTIME" id="0x85" type="actor" dataType="uint16" />
<value name="MALSOURCE1" id="0x86" type="actor" dataType="uint16" />
<value name="MALSOURCE2" id="0x87" type="actor" dataType="uint16" />
<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="LEDTIMING" id="0x88" type="actor" dataType="uint16" />
</values>
</device>

View File

@@ -7,20 +7,6 @@
<values>
<value name="DS18B20_TEMP" id="0x06" type="sensor" dataType="rational" modality="temperature" units="C" denom="16" />
<value name="RGBWSTATE" id="0x81" type="actor" dataType="uint16" modality="onOff" />
<value name="NUMLEDS" id="0x82" type="actor" dataType="int" />
<value name="RGBWVALUE" id="0x83" type="actor" dataType="dword" modality="rgbw"/>
<value name="RGBWMODE" id="0x8b" type="actor" dataType="int" modality="onOffAuto" />
<value name="RGBWTYPE" id="0x8c" type="actor" dataType="int" />
<value name="MALONTIME" id="0x85" type="actor" dataType="uint16" />
<value name="MALSOURCE1" id="0x86" type="actor" dataType="uint16" />
<value name="MALSOURCE2" id="0x87" type="actor" dataType="uint16" />
<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" />