From 22b3b14dfb402999b808e53613ccf8928ce21984 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Fri, 8 May 2026 22:08:06 +0200 Subject: [PATCH] gui: started working on connections page for light settings. --- avr/devices/c03/main/a_c03.asm | 26 +- avr/modules/lcd2/gui/aqhome/d_light_conns.asm | 542 ++++++++++++++++++ 2 files changed, 567 insertions(+), 1 deletion(-) create mode 100644 avr/modules/lcd2/gui/aqhome/d_light_conns.asm diff --git a/avr/devices/c03/main/a_c03.asm b/avr/devices/c03/main/a_c03.asm index 64837f8..8e1a37b 100644 --- a/avr/devices/c03/main/a_c03.asm +++ b/avr/devices/c03/main/a_c03.asm @@ -210,7 +210,7 @@ c03AppCreateWinDebug_ret: ret #endif -#if 1 +#if 0 push yl push yh @@ -241,6 +241,30 @@ c03AppCreateWinDebug_ret: ret #endif + +#if 1 + push yl + push yh + + ldi r20, LOW(RESSOURCE_TXT_LEDCONNECTIONS) + ldi r21, HIGH(RESSOURCE_TXT_LEDCONNECTIONS) + bigcall DlgLightConns_new + mov xl, yl + mov xh, yh + sec + pop yh + pop yl + brcc c03AppCreateWinDebug_ret + std Y+C03APP_OFFS_WDEBUG_LO, xl + std Y+C03APP_OFFS_WDEBUG_HI, xh + + ldi r16, C03APP_SEL_DEBUG + rcall c03AppSetTargetAndSelector + sec +c03AppCreateWinDebug_ret: + ret +#endif + ; @end diff --git a/avr/modules/lcd2/gui/aqhome/d_light_conns.asm b/avr/modules/lcd2/gui/aqhome/d_light_conns.asm new file mode 100644 index 0000000..3f3ea9f --- /dev/null +++ b/avr/modules/lcd2/gui/aqhome/d_light_conns.asm @@ -0,0 +1,542 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_GUI2_AQHOME_D_LIGHT_CONNS_ASM +#define AQH_AVR_GUI2_AQHOME_D_LIGHT_CONNS_ASM + + +; *************************************************************************** +; defines + + +; widget +.equ DLGLIGHTCONNS_OFFS_BEGIN = CDIALOG_SIZE +.equ DLGLIGHTCONNS_OFFS_SETTINGS_LO = DLGLIGHTCONNS_OFFS_BEGIN+0 +.equ DLGLIGHTCONNS_OFFS_SETTINGS_HI = DLGLIGHTCONNS_OFFS_BEGIN+1 +.equ DLGLIGHTCONNS_OFFS_CURRDLG_LO = DLGLIGHTCONNS_OFFS_BEGIN+2 +.equ DLGLIGHTCONNS_OFFS_CURRDLG_HI = DLGLIGHTCONNS_OFFS_BEGIN+3 +.equ DLGLIGHTCONNS_SIZE = DLGLIGHTCONNS_OFFS_BEGIN+4 + + +; selectors +.equ DLGLIGHTCONNS_SEL_BTN_MOTION1 = DIALOG_SEL_NEXTFREE+0 +.equ DLGLIGHTCONNS_SEL_ADDR_MOTION1 = DIALOG_SEL_NEXTFREE+1 +.equ DLGLIGHTCONNS_SEL_VALUE_MOTION1 = DIALOG_SEL_NEXTFREE+2 +.equ DLGLIGHTCONNS_SEL_BTN_MOTION2 = DIALOG_SEL_NEXTFREE+3 +.equ DLGLIGHTCONNS_SEL_ADDR_MOTION2 = DIALOG_SEL_NEXTFREE+4 +.equ DLGLIGHTCONNS_SEL_VALUE_MOTION2 = DIALOG_SEL_NEXTFREE+5 +.equ DLGLIGHTCONNS_SEL_BTN_LIGHT = DIALOG_SEL_NEXTFREE+6 +.equ DLGLIGHTCONNS_SEL_ADDR_LIGHT = DIALOG_SEL_NEXTFREE+7 +.equ DLGLIGHTCONNS_SEL_VALUE_LIGHT = DIALOG_SEL_NEXTFREE+8 +.equ DLGLIGHTCONNS_SEL_BTN_NEXTFREE = DIALOG_SEL_NEXTFREE+9 + + + + +; *************************************************************************** +; code + +.cseg + +; --------------------------------------------------------------------------- +; @routine DlgLightConns_new @global +; +; @param Y pointer to GUIAPP +; @return CFLAG set of okay, cleared otherwise +; @return Y address of newly created object +; @param r21:r20 pointer to settings + +DlgLightConns_new: + bigcall GuiApp_GetRootWindow ; r19:r18=root window (none) + brcc DlgLightConns_new_ret + mov xl, r18 ; use root window as parent for main window + mov xh, r19 + ldi r24, LOW(DLGLIGHTCONNS_SIZE) + ldi r25, HIGH(DLGLIGHTCONNS_SIZE) + push r20 + push r21 + bigcall Object_Alloc ; Y=space (!r16, !r17, !X) + pop r21 + pop r20 + brcc DlgLightConns_new_ret + rcall DlgLightConns_Init +DlgLightConns_new_ret: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine DlgLightConns_Init @global +; +; @param Y pointer to dialog +; @param X pointer to root window +; @return CFLAG set of okay, cleared otherwise +; @param r21:r20 pointer to settings +; @clobbers any, !Y + +DlgLightConns_Init: + push r20 + push r21 + ldi r16, 0 ; OPTS + ldi r17, (WIDGET_PACK_FILLED<