avr: cleanup structure of graphics apps and gui2.

This commit is contained in:
Martin Preuss
2026-01-19 21:10:51 +01:00
parent 504e7568d4
commit 041f0fad6b
16 changed files with 49 additions and 16 deletions

View File

@@ -0,0 +1,56 @@
; ***************************************************************************
; 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_ROOTWIDGET_ASM
#define AQH_AVR_GUI2_ROOTWIDGET_ASM
; ***************************************************************************
; defines
; RootWidget in flash
.equ ROOTWIDGET_OFFS_BEGIN = WIDGET_SIZE
.equ ROOTWIDGET_OFFS_APP_LO = ROOTWIDGET_OFFS_BEGIN+0
.equ ROOTWIDGET_OFFS_APP_HI = ROOTWIDGET_OFFS_BEGIN+1
.equ ROOTWIDGET_SIZE = ROOTWIDGET_OFFS_BEGIN+2
; ***************************************************************************
; code
.cseg
; ---------------------------------------------------------------------------
; @routine RootWidget_GetApp @global
;
; @param Z byte address of object (for LPM!)
; @return R19:R18 byte address pointer to GuiApp
; @clobbers none
RootWidget_GetApp:
bigcall OBJ_IsObject ; (none)
brcc RootWidget_GetApp_ret
adiw zh:zl, ROOTWIDGET_OFFS_APP_LO
lpm r18, Z+
lpm r19, Z
sbiw zh:zl, ROOTWIDGET_OFFS_APP_LO+1
sec
RootWidget_GetApp_ret:
ret
; @end
#endif