From c67fa6ebc990932ccd24225330b2568064350b09 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 10 Aug 2026 19:50:29 +0200 Subject: [PATCH] n14, n25, n30: use new app LightControl instead of old app MA_Light --- avr/devices/n14/defs.asm | 7 +++ avr/devices/n14/main/main.asm | 29 ++++++------ avr/devices/n25/defs.asm | 6 +++ avr/devices/n25/main/main.asm | 89 +++++++---------------------------- avr/devices/n30/defs.asm | 1 + avr/devices/n30/main/main.asm | 37 +-------------- devices/nodes/aqua_n14.xml | 27 ++++++----- devices/nodes/aqua_n25.xml | 28 ++++++----- devices/nodes/aqua_n30.xml | 14 ------ 9 files changed, 77 insertions(+), 161 deletions(-) diff --git a/avr/devices/n14/defs.asm b/avr/devices/n14/defs.asm index f2ba9a5..79cfa7e 100644 --- a/avr/devices/n14/defs.asm +++ b/avr/devices/n14/defs.asm @@ -87,3 +87,10 @@ +; --------------------------------------------------------------------------- +; EEPROM TLV ids + +.equ APP_LIGHTCONTROL_EEID = 0x31 + + + diff --git a/avr/devices/n14/main/main.asm b/avr/devices/n14/main/main.asm index 1161115..2b6d9bf 100644 --- a/avr/devices/n14/main/main.asm +++ b/avr/devices/n14/main/main.asm @@ -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" diff --git a/avr/devices/n25/defs.asm b/avr/devices/n25/defs.asm index 2f217e4..0034bf4 100644 --- a/avr/devices/n25/defs.asm +++ b/avr/devices/n25/defs.asm @@ -99,3 +99,9 @@ .equ SK6812_PINNUM = PORTA6 + +; --------------------------------------------------------------------------- +; EEPROM TLV ids + +.equ APP_LIGHTCONTROL_EEID = 0x31 + diff --git a/avr/devices/n25/main/main.asm b/avr/devices/n25/main/main.asm index d4e6fa6..c795cc0 100644 --- a/avr/devices/n25/main/main.asm +++ b/avr/devices/n25/main/main.asm @@ -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_DS18B20_TEMP = 0x06 -;.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" diff --git a/avr/devices/n30/defs.asm b/avr/devices/n30/defs.asm index 5e200a3..08f889b 100644 --- a/avr/devices/n30/defs.asm +++ b/avr/devices/n30/defs.asm @@ -99,6 +99,7 @@ .equ SK6812_PINNUM = PORTA6 +; --------------------------------------------------------------------------- ; EEPROM TLV ids .equ APP_LIGHTCONTROL_EEID = 0x31 diff --git a/avr/devices/n30/main/main.asm b/avr/devices/n30/main/main.asm index f6b5c0a..126533f 100644 --- a/avr/devices/n30/main/main.asm +++ b/avr/devices/n30/main/main.asm @@ -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 diff --git a/devices/nodes/aqua_n14.xml b/devices/nodes/aqua_n14.xml index ea7b0d2..1aaad82 100644 --- a/devices/nodes/aqua_n14.xml +++ b/devices/nodes/aqua_n14.xml @@ -7,20 +7,23 @@ - - - - - + - - - - - - + + + + + + + + + + + + + + - diff --git a/devices/nodes/aqua_n25.xml b/devices/nodes/aqua_n25.xml index 6bce059..98a9ae5 100644 --- a/devices/nodes/aqua_n25.xml +++ b/devices/nodes/aqua_n25.xml @@ -7,20 +7,24 @@ - - - - - + + + + + + + + + + + + + + + + - - - - - - - diff --git a/devices/nodes/aqua_n30.xml b/devices/nodes/aqua_n30.xml index b28901a..1190515 100644 --- a/devices/nodes/aqua_n30.xml +++ b/devices/nodes/aqua_n30.xml @@ -7,20 +7,6 @@ - - - - - - - - - - - - - -