; *************************************************************************** ; 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_GUICNTRL_ASM #define AQH_AVR_GUI2_GUICNTRL_ASM ; *************************************************************************** ; defines ; *************************************************************************** ; data .dseg guicntl_touch_event: .byte WIDGET_DATA_TOUCH_SIZE guicntl_current_app: .byte 2 ; *************************************************************************** ; code .cseg ; --------------------------------------------------------------------------- ; @routine GuiApp_ShowFirstChild @global ; ; @param Z byte address of guiapp object (for LPM!) GuiCntrl_ShowFirstApp: ; select first child (GuiApp) as current app bigcall OBJ_GetFirstChild mov xl, r18 mov xh, r19 or r18, r19 breq GuiCntrl_ShowFirstApp_ret rcall GuiCntlr_ShowApp GuiCntrl_ShowFirstApp_ret: ret ; @end ; --------------------------------------------------------------------------- ; @routine GuiCntrl_ShowApp @global ; ; @param Z byte address of object (for LPM!) ; @param X byte address of object to raise (for LPM!) ; @return CFLAG set if signal handled ; @clobbers any, !Z GuiCntlr_ShowApp: lds r18, guicntl_current_app lds r19, guicntl_current_app+1 cp r18, xl brne GuiCntlr_ShowApp_changed cp r19, xh breq GuiCntlr_ShowApp_secRet ; already current app GuiCntlr_ShowApp_changed: push zl push zh push xl push xh ; hide previous app mov zl, r18 mov zh, r19 or r18, r19 breq GuiCntlr_ShowApp_l1 bigcall GuiApp_Hide GuiCntlr_ShowApp_l1: pop zh pop zl ; show new app mov r16, zl or r16, zh breq GuiCntlr_ShowApp_l2 bigcall GuiApp_Show GuiCntlr_ShowApp_l2: pop zh pop zl GuiCntlr_ShowApp_secRet: sec ret ; @end ; --------------------------------------------------------------------------- ; @routine GuiCntrl_Every100ms @global ; ; @param Z byte address of guiapp object (for LPM!) GuiCntrl_Every100ms: rcall guiCntrlCheckTouch rcall guiCntrlSendTimer ret ; @end ; --------------------------------------------------------------------------- ; @routine guiCntrlCheckTouch ; ; @param Z byte address of guiapp object (for LPM!) guiCntrlCheckTouch: bigcall Display_InputGetState ; r16=flags, r5:r4=x, r7:r6=y mov r17, r16 andi r17, (1<