c03: removed old main firmware folder, make "test" folder new main.
This commit is contained in:
@@ -43,13 +43,6 @@
|
||||
</subdirs>
|
||||
|
||||
<extradist>
|
||||
data.asm
|
||||
g_app.asm
|
||||
g_win_climate.asm
|
||||
g_win_eepromdump.asm
|
||||
g_win_network.asm
|
||||
g_win_screensaver.asm
|
||||
main.asm
|
||||
style.asm
|
||||
</extradist>
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
|
||||
EEPROM dump
|
||||
RAM dump
|
||||
|
||||
LIGHT
|
||||
- color 1 (EDIT)
|
||||
- color 2 (EDIT)
|
||||
- color 3 (EDIT)
|
||||
- color 4 (EDIT)
|
||||
- mode
|
||||
- on
|
||||
- off
|
||||
- auto
|
||||
|
||||
|
||||
VENTILATOR
|
||||
- current speeds
|
||||
- step 1 (EDIT)
|
||||
- ...
|
||||
- step n (EDIT)
|
||||
|
||||
|
||||
new widgets:
|
||||
- h-slider
|
||||
- v-slider
|
||||
|
||||
463
avr/devices/c03/main/a_c03.asm
Normal file
463
avr/devices/c03/main/a_c03.asm
Normal file
@@ -0,0 +1,463 @@
|
||||
; ***************************************************************************
|
||||
; 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_A_C03_ASM
|
||||
#define AQH_AVR_A_C03_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
.equ C03APP_OFFS_BEGIN = GUIAPP_SIZE
|
||||
.equ C03APP_OFFS_WMENU_LO = C03APP_OFFS_BEGIN+0
|
||||
.equ C03APP_OFFS_WMENU_HI = C03APP_OFFS_BEGIN+1
|
||||
.equ C03APP_OFFS_WCLIMATE_LO = C03APP_OFFS_BEGIN+2
|
||||
.equ C03APP_OFFS_WCLIMATE_HI = C03APP_OFFS_BEGIN+3
|
||||
.equ C03APP_OFFS_WLIGHT_LO = C03APP_OFFS_BEGIN+4
|
||||
.equ C03APP_OFFS_WLIGHT_HI = C03APP_OFFS_BEGIN+5
|
||||
.equ C03APP_OFFS_WWINDOWS_LO = C03APP_OFFS_BEGIN+6
|
||||
.equ C03APP_OFFS_WWINDOWS_HI = C03APP_OFFS_BEGIN+7
|
||||
.equ C03APP_OFFS_WDEBUG_LO = C03APP_OFFS_BEGIN+8
|
||||
.equ C03APP_OFFS_WDEBUG_HI = C03APP_OFFS_BEGIN+9
|
||||
.equ C03APP_OFFS_WNETSTATS_LO = C03APP_OFFS_BEGIN+10
|
||||
.equ C03APP_OFFS_WNETSTATS_HI = C03APP_OFFS_BEGIN+11
|
||||
.equ C03APP_SIZE = C03APP_OFFS_BEGIN+12
|
||||
|
||||
|
||||
; selectors for main windows
|
||||
.equ C03APP_SEL_BACK = 1
|
||||
.equ C03APP_SEL_MENU = 2
|
||||
.equ C03APP_SEL_CLIMATE = 3
|
||||
.equ C03APP_SEL_LIGHT = 4
|
||||
.equ C03APP_SEL_WINDOWS = 5
|
||||
.equ C03APP_SEL_DEBUG = 6
|
||||
.equ C03APP_SEL_NETSTATS = 7
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_new @global
|
||||
;
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
; @param r16 value for OBJECT_OFFS_OPTS
|
||||
; @clobbers any
|
||||
|
||||
C03App_new:
|
||||
ldi r24, LOW(C03APP_SIZE)
|
||||
ldi r25, HIGH(C03APP_SIZE)
|
||||
bigcall Object_Alloc ; (!r16, !r17)
|
||||
brcc C03App_new_ret
|
||||
rcall C03App_Init ; (r16, r17, X)
|
||||
sec
|
||||
C03App_new_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_Init @global
|
||||
;
|
||||
; @param Y address of object in SDRAM
|
||||
; @param r16 value for OBJECT_OFFS_OPTS
|
||||
|
||||
C03App_Init:
|
||||
; call base class
|
||||
bigcall GuiApp_Init ; (r16, r17, X)
|
||||
|
||||
; set default signal map
|
||||
ldi r16, LOW(C03App_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_LO, r16
|
||||
ldi r16, HIGH(C03App_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_HI, r16
|
||||
|
||||
; create main windows
|
||||
rcall c03AppCreateWinMenu ; (any, !Y)
|
||||
rcall c03AppCreateWinClimate ; (any, !Y)
|
||||
rcall c03AppCreateWinNetStats ; (any, !Y)
|
||||
rcall c03AppCreateScreenSaver ; (any, !Y)
|
||||
|
||||
; enter menu window
|
||||
rcall C03App_EnterMenuWin
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine c03AppCreateWinMenu
|
||||
;
|
||||
; @clobbers !X
|
||||
|
||||
c03AppCreateWinMenu:
|
||||
push yl
|
||||
push yh
|
||||
bigcall MenuWin_new
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc c03AppCreateWinMenu_ret
|
||||
std Y+C03APP_OFFS_WMENU_LO, xl
|
||||
std Y+C03APP_OFFS_WMENU_HI, xh
|
||||
ldi r16, C03APP_SEL_MENU
|
||||
rcall c03AppSetTargetAndSelector
|
||||
sec
|
||||
c03AppCreateWinMenu_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine c03AppCreateWinClimate
|
||||
;
|
||||
; @clobbers !X
|
||||
|
||||
c03AppCreateWinClimate:
|
||||
push yl
|
||||
push yh
|
||||
bigcall ClimateWin_new
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc c03AppCreateWinClimate_ret
|
||||
std Y+C03APP_OFFS_WCLIMATE_LO, xl
|
||||
std Y+C03APP_OFFS_WCLIMATE_HI, xh
|
||||
ldi r16, C03APP_SEL_CLIMATE
|
||||
rcall c03AppSetTargetAndSelector
|
||||
sec
|
||||
c03AppCreateWinClimate_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine c03AppCreateWinNetStats
|
||||
;
|
||||
; @clobbers !X
|
||||
|
||||
c03AppCreateWinNetStats:
|
||||
push yl
|
||||
push yh
|
||||
bigcall NetStatWin_new
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc c03AppCreateWinNetStats_ret
|
||||
std Y+C03APP_OFFS_WNETSTATS_LO, xl
|
||||
std Y+C03APP_OFFS_WNETSTATS_HI, xh
|
||||
ldi r16, C03APP_SEL_NETSTATS
|
||||
rcall c03AppSetTargetAndSelector
|
||||
sec
|
||||
c03AppCreateWinNetStats_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine c03AppCreateScreenSaver
|
||||
;
|
||||
; @clobbers !Y
|
||||
|
||||
c03AppCreateScreenSaver:
|
||||
bigcall GuiApp_GetRootWindow
|
||||
brcc c03AppCreateScreenSaver_ret
|
||||
push yl
|
||||
push yh
|
||||
mov xl, r18 ; use root window as parent for main window
|
||||
mov xh, r19
|
||||
ldi r16, (1<<WIDGET_OPTS_INPUT_BIT) | (1<<OBJECT_OPTS_TIMER_BIT) | (1<<OBJECT_OPTS_MSGRECV_BIT)
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
bigcall SimpleSaver_new
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc c03AppCreateScreenSaver_ret
|
||||
bigcall GuiApp_SetScreenSaver
|
||||
sec
|
||||
c03AppCreateScreenSaver_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine c03AppSetTargetAndSelector
|
||||
;
|
||||
; @param r16 selector
|
||||
; @param X pointer to new main window to set target/selector to
|
||||
; @clobbers none
|
||||
|
||||
c03AppSetTargetAndSelector:
|
||||
adiw xh:xl, OBJECT_OFFS_SELECTOR
|
||||
st X, r16
|
||||
sbiw xh:xl, OBJECT_OFFS_SELECTOR
|
||||
adiw xh:xl, OBJECT_OFFS_TARGET_LO
|
||||
st X+, yl ; set target
|
||||
st X, yh
|
||||
sbiw xh:xl, (OBJECT_OFFS_TARGET_LO+1)
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_EnterMenuWin
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_EnterMenuWin:
|
||||
ldd xl, Y+C03APP_OFFS_WMENU_LO
|
||||
ldd xh, Y+C03APP_OFFS_WMENU_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_EnterMenuWin_ret ; nope, jump
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_EnterMenuWin_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdClimate
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdClimate:
|
||||
ldd xl, Y+C03APP_OFFS_WCLIMATE_LO
|
||||
ldd xh, Y+C03APP_OFFS_WCLIMATE_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_OnCmdClimate_ret ; nope, ignore this signal
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_OnCmdClimate_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdLight
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdLight:
|
||||
ldd xl, Y+C03APP_OFFS_WLIGHT_LO
|
||||
ldd xh, Y+C03APP_OFFS_WLIGHT_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_OnCmdLight_ret ; nope, ignore this signal
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_OnCmdLight_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdWindows
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdWindows:
|
||||
ldd xl, Y+C03APP_OFFS_WWINDOWS_LO
|
||||
ldd xh, Y+C03APP_OFFS_WWINDOWS_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_OnCmdWindows_ret ; nope, ignore this signal
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_OnCmdWindows_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdDebug
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdDebug:
|
||||
ldd xl, Y+C03APP_OFFS_WDEBUG_LO
|
||||
ldd xh, Y+C03APP_OFFS_WDEBUG_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_OnCmdDebug_ret ; nope, ignore this signal
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_OnCmdDebug_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdNetStats
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdNetStats:
|
||||
ldd xl, Y+C03APP_OFFS_WNETSTATS_LO
|
||||
ldd xh, Y+C03APP_OFFS_WNETSTATS_HI
|
||||
mov r16, xl ; was window created?
|
||||
or r16, xh
|
||||
breq C03App_OnCmdNetStats_ret ; nope, ignore this signal
|
||||
bigcall GuiApp_EnterWindow
|
||||
C03App_OnCmdNetStats_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_OnCmdBack
|
||||
;
|
||||
; @param Y ptr to this guiapp
|
||||
|
||||
C03App_OnCmdBack:
|
||||
bigcall GuiApp_LeaveWindow
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_CreateButton
|
||||
;
|
||||
; @param X parent
|
||||
; @param r16 value for OBJECT_OFFS_OPTS
|
||||
; @param r17 value for WIDGET_OFFS_PACK
|
||||
; @param r21:r20 img ressource
|
||||
; @param r22 selector
|
||||
; @return CFLAG set if new object created, cleared on error
|
||||
; @return Y button created
|
||||
; @clobbers any, !X
|
||||
|
||||
C03App_CreateButton:
|
||||
push xl
|
||||
push xh
|
||||
push r20
|
||||
push r21
|
||||
push r22
|
||||
ldi r20, BUTTON_MODE_NORMAL
|
||||
bigcall Button_new
|
||||
pop r22
|
||||
pop r21
|
||||
pop r20
|
||||
brcc C03App_CreateButton_done
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
push xl ; Button
|
||||
push xh
|
||||
push r22
|
||||
ldi r16, 0
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
bigcall ImageView_new
|
||||
pop r22
|
||||
pop yh ; pop button into Y
|
||||
pop yl
|
||||
brcc C03App_CreateButton_done
|
||||
pop xh
|
||||
pop xl
|
||||
std Y+OBJECT_OFFS_TARGET_LO, xl
|
||||
std Y+OBJECT_OFFS_TARGET_HI, xh
|
||||
std Y+OBJECT_OFFS_SELECTOR, r22
|
||||
rjmp C03App_CreateButton_ret
|
||||
|
||||
C03App_CreateButton_done:
|
||||
pop xh
|
||||
pop xl
|
||||
C03App_CreateButton_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine C03App_CreateBackButton
|
||||
;
|
||||
; @param X parent
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
; @clobbers any
|
||||
|
||||
C03App_CreateBackButton:
|
||||
ldi r16, 0
|
||||
ldi r17, (WIDGET_PACK_END<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_END<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, LOW(RESSSOURCE_IMG_ARROWBACK)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_ARROWBACK)
|
||||
ldi r22, C03APP_SEL_BACK
|
||||
bigcall C03App_CreateButton
|
||||
brcc C03App_CreateBackButton
|
||||
|
||||
bigcall Widget_GetApp
|
||||
brcc C03App_CreateBackButton_ret
|
||||
std Y+OBJECT_OFFS_TARGET_LO, r18
|
||||
std Y+OBJECT_OFFS_TARGET_HI, r19
|
||||
C03App_CreateBackButton_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in FLASH
|
||||
|
||||
C03App_DefaultSignalmap:
|
||||
; header
|
||||
.dw GuiApp_DefaultSignalmap*2 ; next table to use
|
||||
; entries
|
||||
.db C03APP_SEL_BACK, WIDGET_SIGNAL_COMMAND, LOW(C03App_OnCmdBack), HIGH(C03App_OnCmdBack)
|
||||
.db C03APP_SEL_MENU, MENUWIN_SIGNAL_CLIMATE, LOW(C03App_OnCmdClimate), HIGH(C03App_OnCmdClimate)
|
||||
.db C03APP_SEL_MENU, MENUWIN_SIGNAL_LIGHT, LOW(C03App_OnCmdLight), HIGH(C03App_OnCmdLight)
|
||||
.db C03APP_SEL_MENU, MENUWIN_SIGNAL_WINDOWS, LOW(C03App_OnCmdWindows), HIGH(C03App_OnCmdWindows)
|
||||
.db C03APP_SEL_MENU, MENUWIN_SIGNAL_DEBUG, LOW(C03App_OnCmdDebug), HIGH(C03App_OnCmdDebug)
|
||||
.db C03APP_SEL_MENU, MENUWIN_SIGNAL_NETSTATS, LOW(C03App_OnCmdNetStats), HIGH(C03App_OnCmdNetStats)
|
||||
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; copyright : (C) 2025 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. *
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; 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_DEVICE_C03_APP_ASM
|
||||
#define AQH_AVR_DEVICE_C03_APP_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
|
||||
.equ APPC03_SEL_BUTTON_CLIMATE = 1
|
||||
.equ APPC03_SEL_BUTTON_NETWORK = 2
|
||||
.equ APPC03_SEL_BUTTON_EEDUMP = 3
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
appC03_ramdata:
|
||||
.byte GUIAPP_SD_SIZE
|
||||
|
||||
|
||||
testRootWin_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
|
||||
appC03:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw 0 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw appC03_signalmap*2 ; signal map
|
||||
; GUIAPP
|
||||
.dw appC03_ramdata ; SDRAM data
|
||||
.dw winRoot*2 ; root widget
|
||||
.dw winScreenSaver*2 ; screen saver
|
||||
|
||||
appC03_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_TIMER, LOW(GuiApp_OnTimer), HIGH(GuiApp_OnTimer)
|
||||
.db 0, WIDGET_SIGNAL_TOUCH, LOW(GuiApp_OnTouch), HIGH(GuiApp_OnTouch)
|
||||
.db 0, OBJECT_SIGNAL_RECVMSG, LOW(GuiApp_OnMsgReceived), HIGH(GuiApp_OnMsgReceived)
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(GuiApp_OnCreate), HIGH(GuiApp_OnCreate)
|
||||
.db APPC03_SEL_BUTTON_NETWORK, WIDGET_SIGNAL_CLICKED, LOW(AppC03_OnClickedNetwork), HIGH(AppC03_OnClickedNetwork)
|
||||
.db APPC03_SEL_BUTTON_CLIMATE, WIDGET_SIGNAL_CLICKED, LOW(AppC03_OnClickedClimate), HIGH(AppC03_OnClickedClimate)
|
||||
.db APPC03_SEL_BUTTON_EEDUMP, WIDGET_SIGNAL_CLICKED, LOW(AppC03_OnClickedEeDump), HIGH(AppC03_OnClickedEeDump)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winRoot:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw 0 ; parent
|
||||
.dw winClimate*2 ; first child
|
||||
.dw appC03*2 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw testRootWin_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw testRootWin_ramdata ; ptr to SDRAM
|
||||
; ROOTWIDGET
|
||||
.dw appC03*2 ; GuiApp
|
||||
|
||||
testRootWin_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDrawNop), HIGH(Widget_OnDrawNop)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AppC03_OnClickedNetwork:
|
||||
ldi xl, LOW(winNetwork*2)
|
||||
ldi xh, HIGH(winNetwork*2)
|
||||
bigcall GuiApp_ShowView
|
||||
sec
|
||||
ret
|
||||
|
||||
|
||||
|
||||
AppC03_OnClickedClimate:
|
||||
ldi xl, LOW(winClimate*2)
|
||||
ldi xh, HIGH(winClimate*2)
|
||||
bigcall GuiApp_ShowView
|
||||
sec
|
||||
ret
|
||||
|
||||
|
||||
|
||||
AppC03_OnClickedEeDump:
|
||||
ldi xl, LOW(winEepromDump*2)
|
||||
ldi xh, HIGH(winEepromDump*2)
|
||||
bigcall GuiApp_ShowView
|
||||
sec
|
||||
ret
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,533 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; 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_DEVICE_C03_WIN_CLIMATE_ASM
|
||||
#define AQH_AVR_DEVICE_C03_WIN_CLIMATE_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
winClimate_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateHeader_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateBody_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateSensor1_ramdata:
|
||||
.byte SENSORWATCH_SD_SIZE
|
||||
|
||||
winClimateSensor1Title_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateSensor1Image_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
winClimateSensor1Value_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
winClimateSensor2_ramdata:
|
||||
.byte SENSORWATCH_SD_SIZE
|
||||
|
||||
winClimateSensor2Title_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateSensor2Image_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
winClimateSensor2Value_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
|
||||
winClimateSensor3_ramdata:
|
||||
.byte SENSORWATCH_SD_SIZE
|
||||
|
||||
winClimateSensor3Title_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winClimateSensor3Image_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
winClimateSensor3Value_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
buttonClimateNetwork_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
buttonEepromDump_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
debugValue1_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
winClimate:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetwork*2 ; next
|
||||
.dw winRoot*2 ; parent
|
||||
.dw winClimateHeader*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winClimate_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimate_ramdata ; ptr to SDRAM
|
||||
|
||||
winClimate_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDrawNop), HIGH(Widget_OnDrawNop)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winClimateHeader:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateBody*2 ; next
|
||||
.dw winClimate*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_TITLE_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_TITLE_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateHeader_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winClimateHeader_text*2 ; text
|
||||
|
||||
winClimateHeader_text:
|
||||
.db "Raumklima", 0
|
||||
|
||||
|
||||
|
||||
winClimateBody:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimate*2 ; parent
|
||||
.dw winClimateSensor1*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winClimateBody_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
; .dw DISPLAY_COLOR_YELLOW
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateBody_ramdata ; ptr to SDRAM
|
||||
|
||||
winClimateBody_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winClimateSensor1:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor2*2 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw winClimateSensor1Title*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw SensorWatch_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_MSGRECV_BIT), 0 ; opts lo, hi
|
||||
.dw 4 ; X
|
||||
.dw 4 ; Y
|
||||
.dw 100 ; W (image=96, 2 px borders)
|
||||
.dw 100 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor1_ramdata ; ptr to SDRAM
|
||||
; SENSORWATCH
|
||||
.db VALUE_ID_SENSOR_CO2_BASE, C03_EEID_SENSOR_CO2 ; baseValueId, eepromId
|
||||
|
||||
|
||||
winClimateSensor1Title:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor1Image*2 ; next
|
||||
.dw winClimateSensor1*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 1 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor1Title_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winClimateSensor1Title_text*2 ; text
|
||||
|
||||
winClimateSensor1Title_text:
|
||||
.db "CO2", 0
|
||||
|
||||
|
||||
|
||||
winClimateSensor1Image:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor1Value*2 ; next
|
||||
.dw winClimateSensor1*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ImageView_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw 96 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor1Image_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_CLOUD96 ; ressource id
|
||||
|
||||
|
||||
|
||||
winClimateSensor1Value:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimateSensor1*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2+96+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor1Value_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winClimateSensor2:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor3*2 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw winClimateSensor2Title*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw SensorWatch_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_MSGRECV_BIT), 0 ; opts lo, hi
|
||||
.dw 108 ; X
|
||||
.dw 4 ; Y
|
||||
.dw 100 ; W (image=96, 2 px borders)
|
||||
.dw 100 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor2_ramdata ; ptr to SDRAM
|
||||
; SENSORWATCH
|
||||
.db VALUE_ID_SENSOR_TEMP_BASE, C03_EEID_SENSOR_TEMP ; baseValueId, eepromId
|
||||
|
||||
|
||||
|
||||
winClimateSensor2Title:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor2Image*2 ; next
|
||||
.dw winClimateSensor2*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 1 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor2Title_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winClimateSensor2Title_text*2 ; text
|
||||
|
||||
winClimateSensor2Title_text:
|
||||
.db "Temp", 0, 0
|
||||
|
||||
|
||||
|
||||
winClimateSensor2Image:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor2Value*2 ; next
|
||||
.dw winClimateSensor2*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ImageView_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw 96 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor2Image_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_TEMP96 ; ressource id
|
||||
|
||||
|
||||
|
||||
winClimateSensor2Value:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimateSensor2*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2+96+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor2Value_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 2, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winClimateSensor3:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonClimateNetwork*2 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw winClimateSensor3Title*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw SensorWatch_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_MSGRECV_BIT), 0 ; opts lo, hi
|
||||
.dw 212 ; X
|
||||
.dw 4 ; Y
|
||||
.dw 100 ; W (image=96, 2 px borders)
|
||||
.dw 100 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor3_ramdata ; ptr to SDRAM
|
||||
; SENSORWATCH
|
||||
.db VALUE_ID_SENSOR_HUM_BASE, C03_EEID_SENSOR_HUM ; baseValueId, eepromId
|
||||
|
||||
|
||||
|
||||
winClimateSensor3Title:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor3Image*2 ; next
|
||||
.dw winClimateSensor3*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 1 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor3Title_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winClimateSensor3Title_text*2 ; text
|
||||
|
||||
winClimateSensor3Title_text:
|
||||
.db "Hum", 0
|
||||
|
||||
|
||||
|
||||
winClimateSensor3Image:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winClimateSensor3Value*2 ; next
|
||||
.dw winClimateSensor3*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ImageView_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw 96 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor3Image_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_HUMIDITY96 ; ressource id
|
||||
|
||||
|
||||
|
||||
winClimateSensor3Value:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimateSensor3*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2+96+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winClimateSensor3Value_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
buttonClimateNetwork:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonEepromDump*2 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw appC03*2 ; target
|
||||
.dw APPC03_SEL_BUTTON_NETWORK ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonClimateNetwork_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_NETWORK ; ressource id
|
||||
|
||||
|
||||
|
||||
buttonEepromDump:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw appC03*2 ; target
|
||||
.dw APPC03_SEL_BUTTON_EEDUMP ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw 2+(1*58) ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonEepromDump_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_DEBUGEEPROM ; ressource id
|
||||
|
||||
|
||||
#if 0
|
||||
debugValue1:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winClimateBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNCENTER_BIT) ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw (3*STYLE_WIN_FONT_HEIGHT)+2+96+2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw debugValue1_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,284 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; 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_DEVICE_C03_WIN_EEPROMDUMP_ASM
|
||||
#define AQH_AVR_DEVICE_C03_WIN_EEPROMDUMP_ASM
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
|
||||
; SDRAM data for WINEEPROMDUMP
|
||||
.equ WINEEPROMDUMP_SD_OFFS_BEGIN = WIDGET_SD_SIZE
|
||||
.equ WINEEPROMDUMP_SD_SIZE = WINEEPROMDUMP_SD_OFFS_BEGIN+0
|
||||
|
||||
|
||||
.equ WINEEPROMDUMP_SEL_UP = 1
|
||||
.equ WINEEPROMDUMP_SEL_DOWN = 2
|
||||
.equ WINEEPROMDUMP_SEL_RESET = 3
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
winEepromDump_ramdata:
|
||||
.byte WINEEPROMDUMP_SD_SIZE
|
||||
|
||||
winEepromDumpHeader_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winEepromDumpBody_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winEepromDumpView_ramdata:
|
||||
.byte EEPROMDUMP_SD_SIZE
|
||||
|
||||
buttonEepromDumpBack_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
|
||||
buttonEepromDumpUp_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
buttonEepromDumpDown_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
|
||||
buttonEepromDumpReset_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
winEepromDump:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winScreenSaver*2 ; next
|
||||
.dw winRoot*2 ; parent
|
||||
.dw winEepromDumpHeader*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winEepromDump_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_TIMER_BIT), 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winEepromDump_ramdata ; ptr to SDRAM
|
||||
|
||||
winEepromDump_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winEepromDumpHeader:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winEepromDumpBody*2 ; next
|
||||
.dw winEepromDump*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_TITLE_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_TITLE_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winEepromDumpHeader_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winEepromDumpHeader_text*2 ; text
|
||||
|
||||
winEepromDumpHeader_text:
|
||||
.db "EEPROM", 0, 0
|
||||
|
||||
|
||||
|
||||
winEepromDumpBody:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winEepromDump*2 ; parent
|
||||
.dw winEepromDumpView*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winEepromDumpBody_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winEepromDumpBody_ramdata ; ptr to SDRAM
|
||||
|
||||
winEepromDumpBody_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winEepromDumpView:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonEepromDumpUp*2 ; next
|
||||
.dw winEepromDumpBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winEepromDumpView_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-58 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
; .dw STYLE_WIN_FONT*2 ; font
|
||||
.dw ili9341Font6x8_1*2
|
||||
.dw winEepromDumpView_ramdata ; ptr to SDRAM
|
||||
|
||||
winEepromDumpView_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(EepromDump_OnCreate), HIGH(EepromDump_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(EepromDump_OnDraw), HIGH(EepromDump_OnDraw)
|
||||
.db WINEEPROMDUMP_SEL_UP, WIDGET_SIGNAL_CLICKED, LOW(EepromDump_OnUp), HIGH(EepromDump_OnUp)
|
||||
.db WINEEPROMDUMP_SEL_DOWN, WIDGET_SIGNAL_CLICKED, LOW(EepromDump_OnDown), HIGH(EepromDump_OnDown)
|
||||
.db WINEEPROMDUMP_SEL_RESET, WIDGET_SIGNAL_CLICKED, LOW(EepromDump_OnResetTlv), HIGH(EepromDump_OnResetTlv)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
buttonEepromDumpUp:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonEepromDumpDown*2 ; next
|
||||
.dw winEepromDumpBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw winEepromDumpView*2 ; target
|
||||
.dw WINEEPROMDUMP_SEL_UP ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonEepromDumpUp_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_ARROWUP ; ressource id
|
||||
|
||||
|
||||
|
||||
buttonEepromDumpDown:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonEepromResetTlv*2 ; next
|
||||
.dw winEepromDumpBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw winEepromDumpView*2 ; target
|
||||
.dw WINEEPROMDUMP_SEL_DOWN ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw 2+(1*58) ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonEepromDumpDown_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_ARROWDOWN ; ressource id
|
||||
|
||||
|
||||
|
||||
buttonEepromResetTlv:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonEepromDumpBack*2 ; next
|
||||
.dw winEepromDumpBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw winEepromDumpView*2 ; target
|
||||
.dw WINEEPROMDUMP_SEL_RESET ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw 2+(2*58) ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonEepromDumpReset_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_RESET ; ressource id
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
buttonEepromDumpBack:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winEepromDumpBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw appC03*2 ; target
|
||||
.dw APPC03_SEL_BUTTON_CLIMATE ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw DISPLAY_WIDTH-56 ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonEepromDumpBack_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_ARROWBACK ; ressource id
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,521 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; 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_DEVICE_C03_WIN_NETWORK_ASM
|
||||
#define AQH_AVR_DEVICE_C03_WIN_NETWORK_ASM
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
|
||||
.equ WINNETWORK_INTERVAL_100ms = 50 ; update every 5s
|
||||
|
||||
; SDRAM data for WINNETWORK
|
||||
.equ WINNETWORK_SD_OFFS_BEGIN = WIDGET_SD_SIZE
|
||||
.equ WINNETWORK_SD_OFFS_TIMER = WINNETWORK_SD_OFFS_BEGIN+0
|
||||
.equ WINNETWORK_SD_SIZE = WINNETWORK_SD_OFFS_BEGIN+1
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
winNetwork_ramdata:
|
||||
.byte WINNETWORK_SD_SIZE
|
||||
|
||||
winNetworkHeader_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkBody_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkLabel1_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkLabel2_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkLabel3_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkLabel4_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkLabel5_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
winNetworkValue1_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
winNetworkValue2_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
winNetworkValue3_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
winNetworkValue4_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
winNetworkValue5_ramdata:
|
||||
.byte VLABEL_SD_SIZE
|
||||
|
||||
buttonNetworkBack_ramdata:
|
||||
.byte IMGVIEW_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
winNetwork:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winEepromDump*2 ; next
|
||||
.dw winRoot*2 ; parent
|
||||
.dw winNetworkHeader*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winNetwork_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_TIMER_BIT), 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetwork_ramdata ; ptr to SDRAM
|
||||
|
||||
winNetwork_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_TIMER, LOW(WinNetwork_OnTimer), HIGH(WinNetwork_OnTimer)
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(WinNetwork_OnCreate), HIGH(WinNetwork_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winNetworkHeader:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkBody*2 ; next
|
||||
.dw winNetwork*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_TITLE_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_TITLE_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkHeader_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkHeader_text*2 ; text
|
||||
|
||||
winNetworkHeader_text:
|
||||
.db "Netzwerk", 0, 0
|
||||
|
||||
|
||||
|
||||
winNetworkBody:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winNetwork*2 ; parent
|
||||
.dw winNetworkLabel1*2 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw winNetworkBody_signalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw STYLE_WIN_TITLE_HEIGHT ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
; .dw DISPLAY_COLOR_YELLOW
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkBody_ramdata ; ptr to SDRAM
|
||||
|
||||
winNetworkBody_signalmap:
|
||||
.db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
winNetworkLabel1:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkLabel2*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 2 ; Y
|
||||
.dw 160 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkLabel1_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkLabel1_text*2 ; text
|
||||
|
||||
winNetworkLabel1_text:
|
||||
.db "Packets in", 0, 0
|
||||
|
||||
|
||||
winNetworkLabel2:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkLabel3*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 2+(1*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 160 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkLabel2_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkLabel2_text*2 ; text
|
||||
|
||||
winNetworkLabel2_text:
|
||||
.db "Packets out", 0
|
||||
|
||||
|
||||
|
||||
winNetworkLabel3:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkLabel4*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 2+(2*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 160 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkLabel3_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkLabel3_text*2 ; text
|
||||
|
||||
winNetworkLabel3_text:
|
||||
.db "eContent", 0, 0
|
||||
|
||||
|
||||
|
||||
winNetworkLabel4:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkLabel5*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 2+(3*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 160 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkLabel4_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkLabel4_text*2 ; text
|
||||
|
||||
winNetworkLabel4_text:
|
||||
.db "eIO", 0
|
||||
|
||||
|
||||
|
||||
winNetworkLabel5:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkValue1*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw Label_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, 0 ; opts lo, hi
|
||||
.dw 2 ; X
|
||||
.dw 2+(4*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 160 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+2 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkLabel5_ramdata ; ptr to SDRAM
|
||||
; LABEL
|
||||
.dw winNetworkLabel5_text*2 ; text
|
||||
|
||||
winNetworkLabel5_text:
|
||||
.db "eMsgSize", 0, 0
|
||||
|
||||
|
||||
|
||||
winNetworkValue1:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkValue2*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNRIGHT_BIT) ; opts lo, hi
|
||||
.dw 164 ; X
|
||||
.dw 2 ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkValue1_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winNetworkValue2:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkValue3*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNRIGHT_BIT) ; opts lo, hi
|
||||
.dw 164 ; X
|
||||
.dw 2+(1*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkValue2_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winNetworkValue3:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkValue4*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNRIGHT_BIT) ; opts lo, hi
|
||||
.dw 164 ; X
|
||||
.dw 2+(2*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkValue3_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winNetworkValue4:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw winNetworkValue5*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNRIGHT_BIT) ; opts lo, hi
|
||||
.dw 164 ; X
|
||||
.dw 2+(3*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkValue4_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
winNetworkValue5:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw buttonNetworkBack*2 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ValueLabel_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db 0, (1<<WIDGET_OPTSHI_HALIGNRIGHT_BIT) ; opts lo, hi
|
||||
.dw 164 ; X
|
||||
.dw 2+(4*(STYLE_WIN_FONT_HEIGHT+2)) ; Y
|
||||
.dw 96 ; W
|
||||
.dw STYLE_WIN_FONT_HEIGHT+4 ; H
|
||||
.dw STYLE_WIN_FOREGROUND ; front color
|
||||
.dw STYLE_WIN_BACKGROUND ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winNetworkValue5_ramdata ; ptr to SDRAM
|
||||
; VALUELABEL
|
||||
.db 0, 0 ; num of post-komma digits
|
||||
|
||||
|
||||
|
||||
|
||||
buttonNetworkBack:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winNetworkBody*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw appC03*2 ; target
|
||||
.dw APPC03_SEL_BUTTON_CLIMATE ; selector (ony lower 8 bits used)
|
||||
.dw Button_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_BORDER_BIT), 0 ; opts lo, hi
|
||||
.dw DISPLAY_WIDTH-56 ; X
|
||||
.dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT-56 ; Y
|
||||
.dw 52 ; W
|
||||
.dw 52 ; H
|
||||
.dw STYLE_BUTTON_COL_FG_NORM ; front color
|
||||
.dw STYLE_BUTTON_COL_BG_NORM ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw buttonClimateNetwork_ramdata ; ptr to SDRAM
|
||||
; IMGVIEW
|
||||
.dw RESSSOURCE_IMG_ARROWBACK ; ressource id
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
WinNetwork_OnCreate:
|
||||
bigcall Widget_OnCreate
|
||||
bigcall Widget_GetSdramPtr ; (none)
|
||||
ldi r16, WINNETWORK_INTERVAL_100ms
|
||||
std Y+WINNETWORK_SD_OFFS_TIMER, r16
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
WinNetwork_OnTimer:
|
||||
push zl
|
||||
push zh
|
||||
bigcall Widget_GetSdramPtr ; (none)
|
||||
ldd r16, Y+WINNETWORK_SD_OFFS_TIMER
|
||||
tst r16
|
||||
breq WinNetwork_OnTimer_ret
|
||||
dec r16
|
||||
brne WinNetwork_OnTimer_store
|
||||
|
||||
ldi zl, LOW(winNetworkValue1*2)
|
||||
ldi zh, HIGH(winNetworkValue1*2)
|
||||
ldi r16, VLABEL_SIGNAL_SETVALUE
|
||||
clr r17
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_PACKETSIN_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_PACKETSIN_HIGH
|
||||
bigcall OBJ_HandleSignal
|
||||
|
||||
ldi zl, LOW(winNetworkValue2*2)
|
||||
ldi zh, HIGH(winNetworkValue2*2)
|
||||
ldi r16, VLABEL_SIGNAL_SETVALUE
|
||||
clr r17
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_PACKETSOUT_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_PACKETSOUT_HIGH
|
||||
bigcall OBJ_HandleSignal
|
||||
|
||||
ldi zl, LOW(winNetworkValue3*2)
|
||||
ldi zh, HIGH(winNetworkValue3*2)
|
||||
ldi r16, VLABEL_SIGNAL_SETVALUE
|
||||
clr r17
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_CONTENT_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_CONTENT_HIGH
|
||||
bigcall OBJ_HandleSignal
|
||||
|
||||
ldi zl, LOW(winNetworkValue4*2)
|
||||
ldi zh, HIGH(winNetworkValue4*2)
|
||||
ldi r16, VLABEL_SIGNAL_SETVALUE
|
||||
clr r17
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_IO_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_IO_HIGH
|
||||
bigcall OBJ_HandleSignal
|
||||
|
||||
ldi zl, LOW(winNetworkValue5*2)
|
||||
ldi zh, HIGH(winNetworkValue5*2)
|
||||
ldi r16, VLABEL_SIGNAL_SETVALUE
|
||||
clr r17
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_MSGSIZE_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_MSGSIZE_HIGH
|
||||
bigcall OBJ_HandleSignal
|
||||
|
||||
ldi r16, WINNETWORK_INTERVAL_100ms
|
||||
WinNetwork_OnTimer_store:
|
||||
std Y+WINNETWORK_SD_OFFS_TIMER, r16
|
||||
WinNetwork_OnTimer_ret:
|
||||
pop zh
|
||||
pop zl
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,55 +0,0 @@
|
||||
; ***************************************************************************
|
||||
; 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_DEVICE_C03_WIN_SCREENSAVER_ASM
|
||||
#define AQH_AVR_DEVICE_C03_WIN_SCREENSAVER_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
winScreenSaver_ramdata:
|
||||
.byte WIDGET_SD_SIZE
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
winScreenSaver:
|
||||
; OBJECT
|
||||
.db 0x55, 0xaa ; magic
|
||||
.dw 0 ; next
|
||||
.dw winRoot*2 ; parent
|
||||
.dw 0 ; first child
|
||||
.dw 0 ; target
|
||||
.dw 0 ; selector (ony lower 8 bits used)
|
||||
.dw ScreenSaver_DefaultSignalmap*2 ; signal map
|
||||
; WIDGET
|
||||
.db (1<<WIDGET_OPTSLO_INPUT_BIT) | (1<<WIDGET_OPTSLO_TIMER_BIT) | (1<<WIDGET_OPTSLO_MSGRECV_BIT), 0 ; opts lo, hi
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH ; W
|
||||
.dw DISPLAY_HEIGHT ; H
|
||||
.dw DISPLAY_COLOR_LIGHTGREY ; front color
|
||||
.dw DISPLAY_COLOR_BLACK ; back color
|
||||
.dw STYLE_WIN_FONT*2 ; font
|
||||
.dw winScreenSaver_ramdata ; ptr to SDRAM
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
.include "version.asm"
|
||||
.include "../defs.asm"
|
||||
.include "./data.asm"
|
||||
|
||||
.include "devices/all/defs.asm"
|
||||
.include "common/calls.asm"
|
||||
@@ -47,7 +46,7 @@
|
||||
; #define MODULES_TIMER
|
||||
#define MODULES_CLOCK
|
||||
;#define MODULES_XRAM
|
||||
;#define MODULES_HEAP
|
||||
#define MODULES_HEAP
|
||||
#define MODULES_BEEPER_SIMPLE
|
||||
#define MODULES_LED_SIMPLE
|
||||
#define MODULES_NETWORK
|
||||
@@ -59,7 +58,7 @@
|
||||
#define MODULES_ILI9341
|
||||
#define MODULES_XPT2046
|
||||
#define MODULES_FONT
|
||||
#define MODULES_GUI
|
||||
;#define MODULES_GUI
|
||||
;#define MODULES_TWI_MASTER
|
||||
;#define MODULES_LCD
|
||||
;#define LCD_MINIMAL_FONT
|
||||
@@ -200,8 +199,8 @@ onSystemStart:
|
||||
; Called on every message received
|
||||
|
||||
onMessageReceived:
|
||||
ldi zl, LOW(appC03*2)
|
||||
ldi zh, HIGH(appC03*2)
|
||||
lds yl, guiApp
|
||||
lds yh, guiApp+1
|
||||
bigcall GuiApp_MsgReceived
|
||||
clc
|
||||
ret
|
||||
@@ -215,8 +214,8 @@ onMessageReceived:
|
||||
; Called every 100ms. Add your routine calls here. No arguments, no results.
|
||||
|
||||
onEvery100ms:
|
||||
ldi zl, LOW(appC03*2)
|
||||
ldi zh, HIGH(appC03*2)
|
||||
lds yl, guiApp
|
||||
lds yh, guiApp+1
|
||||
bigcall GuiApp_Every100ms
|
||||
ret
|
||||
|
||||
@@ -244,13 +243,255 @@ onEveryLoop:
|
||||
|
||||
|
||||
test:
|
||||
ldi zl, LOW(appC03*2)
|
||||
ldi zh, HIGH(appC03*2)
|
||||
bigcall GuiApp_Init
|
||||
bigcall C03App_new
|
||||
sts guiApp, yl
|
||||
sts guiApp+1, yh
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; ; debug
|
||||
; ldi r16, LOW(Debug_Style*2)
|
||||
; std Y+WIDGET_OFFS_STYLE_LO, r16
|
||||
; ldi r16, HIGH(Debug_Style*2)
|
||||
; std Y+WIDGET_OFFS_STYLE_HI, r16
|
||||
|
||||
DEBUG_STOP:
|
||||
bigjmp DEBUG1
|
||||
|
||||
|
||||
DEBUG_STOP2:
|
||||
bigjmp DEBUG2
|
||||
|
||||
DEBUG_STOP3:
|
||||
bigjmp DEBUG3
|
||||
|
||||
|
||||
|
||||
DEBUG_DUMPCTX:
|
||||
lds yl, guiApp
|
||||
lds yh, guiApp+1
|
||||
bigcall GuiApp_GetRootWindow
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
|
||||
bigcall Widget_Clear
|
||||
|
||||
clr r4
|
||||
clr r5
|
||||
clr r6
|
||||
clr r7
|
||||
|
||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||
ld r24, X+
|
||||
|
||||
DEBUG_DUMPCTX_loop:
|
||||
clr r4
|
||||
clr r5
|
||||
rcall DEBUG_DUMPCTXITEM
|
||||
ldi r16, 20
|
||||
clr r17
|
||||
add r6, r16
|
||||
adc r7, r17
|
||||
dec r24
|
||||
brne DEBUG_DUMPCTX_loop
|
||||
bigjmp DEBUG3
|
||||
|
||||
|
||||
DEBUG_DUMPONEITEM:
|
||||
lds yl, guiApp
|
||||
lds yh, guiApp+1
|
||||
bigcall GuiApp_GetRootWindow
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall Widget_Clear
|
||||
|
||||
clr r4
|
||||
clr r5
|
||||
clr r6
|
||||
clr r7
|
||||
rjmp DEBUG_DUMPCTXITEM
|
||||
|
||||
DEBUG_DUMPCTXITEM:
|
||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO
|
||||
ld r20, X+ ; pos
|
||||
ld r21, X+
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ld r20, X+ ; size
|
||||
ld r21, X+
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ld r20, X+ ; flags
|
||||
clr r21
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
ret
|
||||
|
||||
|
||||
|
||||
DEBUG_DUMPWDG:
|
||||
lds yl, guiApp
|
||||
lds yh, guiApp+1
|
||||
bigcall GuiApp_GetRootWindow
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
|
||||
push zl
|
||||
push zh
|
||||
bigcall Widget_Clear
|
||||
pop zh
|
||||
pop zl
|
||||
|
||||
clr r4
|
||||
clr r5
|
||||
clr r6
|
||||
clr r7
|
||||
|
||||
ldi r16, 3
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
rcall DEBUG_DUMPCWDG
|
||||
ldi r16, 20
|
||||
clr r17
|
||||
add r6, r16
|
||||
adc r7, r17
|
||||
|
||||
push yl
|
||||
push yh
|
||||
mov yl, zl
|
||||
mov yh, zh
|
||||
bigcall OBJ_GetFirstChild
|
||||
pop yh
|
||||
pop yl
|
||||
mov zl, r18
|
||||
mov zh, r19
|
||||
ldi r24, 11
|
||||
DEBUG_DUMPWDG_loop:
|
||||
rcall DEBUG_DUMPCWDG
|
||||
|
||||
ldi r16, 20
|
||||
clr r17
|
||||
add r6, r16
|
||||
adc r7, r17
|
||||
dec r24
|
||||
breq DEBUG_DUMPWDG_end
|
||||
push yl
|
||||
push yh
|
||||
mov yl, zl
|
||||
mov yh, zh
|
||||
bigcall OBJ_GetNext
|
||||
pop yh
|
||||
pop yl
|
||||
mov zl, r18
|
||||
mov zh, r19
|
||||
brcc DEBUG_DUMPWDG_end
|
||||
rjmp DEBUG_DUMPWDG_loop
|
||||
|
||||
DEBUG_DUMPWDG_end:
|
||||
bigjmp DEBUG3
|
||||
|
||||
|
||||
DEBUG_DUMPCWDG:
|
||||
clr r4
|
||||
clr r5
|
||||
|
||||
ldd r20, Z+WIDGET_OFFS_X_LO
|
||||
ldd r21, Z+WIDGET_OFFS_X_HI
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ldd r20, Z+WIDGET_OFFS_Y_LO
|
||||
ldd r21, Z+WIDGET_OFFS_Y_HI
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ldd r20, Z+WIDGET_OFFS_WIDTH_LO
|
||||
ldd r21, Z+WIDGET_OFFS_WIDTH_HI
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ldd r20, Z+WIDGET_OFFS_HEIGHT_LO
|
||||
ldd r21, Z+WIDGET_OFFS_HEIGHT_HI
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
|
||||
ldd r20, Z+WIDGET_OFFS_TMP_LO
|
||||
ldd r21, Z+WIDGET_OFFS_TMP_HI
|
||||
rcall DEBUG_WRITE_INT
|
||||
ldi r16, 65
|
||||
clr r17
|
||||
add r4, r16
|
||||
adc r5, r17
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
; @param r21:r20: number
|
||||
DEBUG_WRITE_INT:
|
||||
push r24
|
||||
push zl
|
||||
push zh
|
||||
ldi r24, 0
|
||||
push xl
|
||||
push xh
|
||||
bigcall IntToAscii ; X=pointer to text
|
||||
push r4
|
||||
push r5
|
||||
bigcall Widget_DrawTextRam ; (any, !Y)
|
||||
pop r5
|
||||
pop r4
|
||||
pop xh
|
||||
pop xl
|
||||
pop zh
|
||||
pop zl
|
||||
pop r24
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Debug_Style:
|
||||
.dw DISPLAY_COLOR_BLACK ; frontCol_norm
|
||||
.dw DISPLAY_COLOR_GREEN ; backCol_norm
|
||||
.dw DISPLAY_COLOR_BLACK ; borderCol_norm
|
||||
.dw DISPLAY_COLOR_WHITE ; shadowCol_norm
|
||||
|
||||
.dw DISPLAY_COLOR_WHITE ; frontCol_activated
|
||||
.dw DISPLAY_COLOR_NAVY ; backCol_activated
|
||||
.dw DISPLAY_COLOR_BLACK ; borderCol_activated
|
||||
.dw DISPLAY_COLOR_WHITE ; shadowCol_activated
|
||||
|
||||
.db 2, 1 ; outerBorderSize, innerBorderSize
|
||||
.dw ili9341Font12x16_1*2 ; font
|
||||
.db 12, 16 ; charWidth, charHeight
|
||||
|
||||
|
||||
|
||||
@@ -264,12 +505,6 @@ test:
|
||||
|
||||
.include "common/debug.asm"
|
||||
|
||||
;.include "modules/lcd2/font/font2.asm"
|
||||
;.include "modules/lcd2/font/font3.asm"
|
||||
;.include "modules/lcd2/font/font16x26.asm"
|
||||
;.include "modules/lcd2/font/font4.asm"
|
||||
;.include "modules/lcd2/font/font12x16.asm"
|
||||
|
||||
.include "modules/lcd2/ili9341/font12x16.asm"
|
||||
.include "modules/lcd2/ili9341/font12x16_1.asm"
|
||||
|
||||
@@ -290,23 +525,36 @@ test:
|
||||
|
||||
.include "style.asm"
|
||||
|
||||
.include "modules/lcd2/gui/generic/object.asm"
|
||||
.include "modules/lcd2/gui/generic/widget.asm"
|
||||
.include "modules/lcd2/gui/generic/rootwidget.asm"
|
||||
.include "modules/lcd2/gui/generic/label.asm"
|
||||
.include "modules/lcd2/gui/generic/button.asm"
|
||||
.include "modules/lcd2/gui/generic/imageview.asm"
|
||||
.include "modules/lcd2/gui/generic/valuelabel.asm"
|
||||
.include "modules/lcd2/gui/generic/guiapp.asm"
|
||||
.include "modules/lcd2/gui/generic/screensaver.asm"
|
||||
.include "modules/lcd2/gui/sensorwatch.asm"
|
||||
.include "modules/lcd2/gui/eepromdump.asm"
|
||||
|
||||
.include "g_app.asm"
|
||||
.include "g_win_climate.asm"
|
||||
.include "g_win_network.asm"
|
||||
.include "g_win_eepromdump.asm"
|
||||
.include "g_win_screensaver.asm"
|
||||
GUI2_MODULE_BEGIN:
|
||||
.include "modules/lcd2/gui2/base/object.asm"
|
||||
.include "modules/lcd2/gui2/base/widget.asm"
|
||||
;.include "modules/lcd2/gui2/base/layout.asm"
|
||||
;.include "modules/lcd2/gui2/base/hlayout.asm"
|
||||
;.include "modules/lcd2/gui2/base/vlayout.asm"
|
||||
;.include "modules/lcd2/gui2/base/mlayout.asm"
|
||||
;.include "modules/lcd2/gui2/base/mlayout_column.asm"
|
||||
.include "modules/lcd2/gui2/base/guiapp.asm"
|
||||
.include "modules/lcd2/gui2/base/rootwindow.asm"
|
||||
.include "modules/lcd2/gui2/base/label.asm"
|
||||
.include "modules/lcd2/gui2/base/button.asm"
|
||||
.include "modules/lcd2/gui2/base/imageview.asm"
|
||||
.include "modules/lcd2/gui2/base/valuelabel.asm"
|
||||
.include "modules/lcd2/gui2/base/layout.asm"
|
||||
.include "modules/lcd2/gui2/base/hlayout.asm"
|
||||
.include "modules/lcd2/gui2/base/vlayout.asm"
|
||||
.include "modules/lcd2/gui2/base/mclayout.asm"
|
||||
.include "modules/lcd2/gui2/base/mainwindow.asm"
|
||||
.include "modules/lcd2/gui2/aqhome/sensorwatch.asm"
|
||||
.include "modules/lcd2/gui2/screensavers/simple.asm"
|
||||
GUI2_MODULE_END:
|
||||
.equ MODULE_SIZE_GUI2 = GUI2_MODULE_END-GUI2_MODULE_BEGIN
|
||||
|
||||
.include "a_c03.asm"
|
||||
.include "w_menu.asm"
|
||||
.include "w_climate.asm"
|
||||
.include "w_netstats.asm"
|
||||
|
||||
|
||||
.include "ressources.inc"
|
||||
|
||||
@@ -319,6 +567,7 @@ test:
|
||||
.equ netInterfaceData = com2w_iface
|
||||
|
||||
|
||||
|
||||
deviceCodeEnd:
|
||||
.if deviceCodeEnd >= BOOTLOADER_ADDR
|
||||
.warning "Code reaches into boot loader!"
|
||||
@@ -329,9 +578,13 @@ deviceCodeEnd:
|
||||
|
||||
.dseg
|
||||
|
||||
guiApp: .byte 2
|
||||
|
||||
|
||||
|
||||
heapStart:
|
||||
|
||||
.equ HEAP_START = heapStart
|
||||
.equ HEAP_SIZE = (SRAM_SIZE-STACK_SIZE)-HEAP_START
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
.org RESSOURCE_ADDR
|
||||
|
||||
RessourceTable:
|
||||
.dw 29 ; num of ressources
|
||||
.dw 41 ; num of ressources
|
||||
.dw (resImageNetwork*2) ; 0: RESSSOURCE_IMG_NETWORK
|
||||
.dw (resImageCloud*2) ; 1: RESSSOURCE_IMG_CLOUD
|
||||
.dw (resImageTemp*2) ; 2: RESSSOURCE_IMG_TEMP
|
||||
@@ -54,6 +54,20 @@ RessourceTable:
|
||||
.dw (resTextAttic*2) ; 26: RESSSOURCE_TXT_ATTIC
|
||||
.dw (resImageReset*2) ; 27: RESSSOURCE_IMG_RESET
|
||||
.dw (resImageDebugEeprom*2) ; 28: RESSSOURCE_IMG_DEBUGEEPROM
|
||||
.dw (resTextC02_s*2) ; 29: RESSSOURCE_TXT_CO2_S
|
||||
.dw (resTextTemp_s*2) ; 30: RESSSOURCE_TXT_TEMP_S
|
||||
.dw (resTextHum_s*2) ; 31: RESSSOURCE_TXT_HUM_S
|
||||
.dw (resTextUnknown_s*2) ; 32: RESSSOURCE_TXT_UNKNOWN_S
|
||||
.dw (resTextRoomClimate*2) ; 33: RESSSOURCE_TXT_ROOMCLIMATE
|
||||
.dw (resTextAqHome*2) ; 34: RESSSOURCE_TXT_AQHOME
|
||||
|
||||
.dw (resTextPacketsIn*2) ; 35: RESSSOURCE_TXT_PACKETSIN
|
||||
.dw (resTextPacketsOut*2) ; 36: RESSSOURCE_TXT_PACKETSOUT
|
||||
.dw (resTextEContent*2) ; 37: RESSSOURCE_TXT_ECONTENT
|
||||
.dw (resTextEMsgSize*2) ; 38: RESSSOURCE_TXT_EMSGSIZE
|
||||
.dw (resTextEIO*2) ; 39: RESSSOURCE_TXT_EIO
|
||||
.dw (resTextNetStats*2) ; 40: RESSSOURCE_TXT_NETSTATS
|
||||
|
||||
|
||||
|
||||
resImageNetwork:
|
||||
@@ -104,7 +118,7 @@ resImageCloudPixels:
|
||||
.db 0xff, 0x02, 0xd0, 0x01, 0x8a, 0xff, 0x02, 0xd0, 0x01, 0x8a, 0xff, 0x03, 0xd0, 0x00, 0x7f, 0x89
|
||||
.db 0xff, 0x03, 0x40, 0x00, 0x7f, 0x89, 0xff, 0x03, 0x40, 0x00, 0x1f, 0x88, 0xff, 0x04, 0xfd, 0x00
|
||||
.db 0x00, 0x05, 0x88, 0xff, 0x05, 0xd4, 0x00, 0x00, 0x00, 0x5f, 0x86, 0xff, 0x06, 0xfd, 0x40, 0x00
|
||||
.db 0x00, 0x00, 0x05, 0x86, 0x55, 0x01, 0x54, 0xfa, 0x00
|
||||
.db 0x00, 0x00, 0x05, 0x86, 0x55, 0x01, 0x54, 0xfa, 0x00, 0x00
|
||||
|
||||
|
||||
|
||||
@@ -137,7 +151,7 @@ resImageTempPixels:
|
||||
.db 0xff, 0xff, 0xfc, 0x10, 0x86, 0x00, 0x06, 0x04, 0xff, 0xff, 0xff, 0xfc, 0x40, 0x86, 0x00, 0x06
|
||||
.db 0x04, 0x3f, 0xff, 0xff, 0xf0, 0x40, 0x86, 0x00, 0x05, 0x01, 0x03, 0xff, 0xff, 0x01, 0x88, 0x00
|
||||
.db 0x04, 0x40, 0x3f, 0xf0, 0x04, 0x88, 0x00, 0x04, 0x14, 0x00, 0x00, 0x50, 0x88, 0x00, 0x03, 0x01
|
||||
.db 0x40, 0x05, 0x8a, 0x00, 0x02, 0x15, 0x50, 0x91, 0x00
|
||||
.db 0x40, 0x05, 0x8a, 0x00, 0x02, 0x15, 0x50, 0x91, 0x00, 0x00
|
||||
|
||||
|
||||
resImageHumidity:
|
||||
@@ -204,7 +218,7 @@ resImageLightPixels:
|
||||
.db 0x04, 0x1f, 0xff, 0xff, 0xd0, 0x88, 0x00, 0x04, 0x1d, 0x55, 0x55, 0xd0, 0x88, 0x00, 0x04, 0x1f
|
||||
.db 0xff, 0xff, 0xd0, 0x88, 0x00, 0x04, 0x1d, 0x55, 0x55, 0xd0, 0x88, 0x00, 0x04, 0x1f, 0xff, 0xff
|
||||
.db 0xd0, 0x88, 0x00, 0x04, 0x07, 0xd5, 0x5f, 0x40, 0x88, 0x00, 0x03, 0x01, 0xff, 0xfd, 0x8a, 0x00
|
||||
.db 0x02, 0x55, 0x54, 0x91, 0x00
|
||||
.db 0x02, 0x55, 0x54, 0x91, 0x00, 0x00
|
||||
|
||||
|
||||
resImageWindowOpen:
|
||||
@@ -244,7 +258,7 @@ resImageWindowOpenPixels:
|
||||
.db 0x00, 0x00, 0x67, 0xff, 0x50, 0x84, 0x00, 0x07, 0x05, 0xff, 0xd9, 0x00, 0x00, 0x67, 0xf5, 0x86
|
||||
.db 0x00, 0x06, 0x5f, 0xd9, 0x00, 0x00, 0x67, 0x50, 0x86, 0x00, 0x05, 0x05, 0xd9, 0x00, 0x00, 0x65
|
||||
.db 0x88, 0x00, 0x04, 0x59, 0x00, 0x00, 0x6a, 0x88, 0xaa, 0x03, 0xa9, 0x00, 0x00, 0x8a, 0x55, 0x03
|
||||
.db 0x00, 0x00, 0x6a, 0x88, 0xaa, 0x03, 0xa9, 0x00, 0x00, 0x8a, 0x55, 0x99, 0x00
|
||||
.db 0x00, 0x00, 0x6a, 0x88, 0xaa, 0x03, 0xa9, 0x00, 0x00, 0x8a, 0x55, 0x99, 0x00, 0x00
|
||||
|
||||
|
||||
resImageWindowClosed:
|
||||
@@ -284,7 +298,7 @@ resImageWindowClosedPixels:
|
||||
.db 0x00, 0x67, 0xff, 0xff, 0xff, 0xfd, 0x84, 0xff, 0x08, 0xd9, 0x00, 0x00, 0x67, 0xff, 0xff, 0xff
|
||||
.db 0xfd, 0x84, 0xff, 0x04, 0xd9, 0x00, 0x00, 0x65, 0x88, 0x55, 0x04, 0x59, 0x00, 0x00, 0x6a, 0x88
|
||||
.db 0xaa, 0x03, 0xa9, 0x00, 0x00, 0x8a, 0x55, 0x03, 0x00, 0x00, 0x6a, 0x88, 0xaa, 0x03, 0xa9, 0x00
|
||||
.db 0x00, 0x8a, 0x55, 0x99, 0x00
|
||||
.db 0x00, 0x8a, 0x55, 0x99, 0x00, 0x00
|
||||
|
||||
|
||||
resImageDebugEeprom:
|
||||
@@ -1023,6 +1037,42 @@ resTextCellar:
|
||||
resTextAttic:
|
||||
.db "Dachboden", 0
|
||||
|
||||
resTextC02_s:
|
||||
.db "CO2", 0
|
||||
|
||||
resTextTemp_s:
|
||||
.db "Temp", 0, 0
|
||||
|
||||
resTextHum_s:
|
||||
.db "Luft", 0, 0
|
||||
|
||||
resTextUnknown_s:
|
||||
.db "???", 0
|
||||
|
||||
resTextRoomClimate:
|
||||
.db "Raumklima", 0
|
||||
|
||||
|
||||
resTextAqHome:
|
||||
.db "AqHome", 0, 0
|
||||
|
||||
resTextPacketsIn:
|
||||
.db "Eingehende Pakete:", 0
|
||||
|
||||
resTextPacketsOut:
|
||||
.db "Ausgehende Pakete:", 0
|
||||
|
||||
resTextEContent:
|
||||
.db "CRC Fehler:", 0
|
||||
|
||||
resTextEMsgSize:
|
||||
.db "MsgSize Fehler:", 0
|
||||
|
||||
resTextEIO:
|
||||
.db "IO Fehler:", 0, 0
|
||||
|
||||
resTextNetStats:
|
||||
.db "Netzwerk Statistik", 0, 0
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,18 @@
|
||||
.equ RESSSOURCE_TXT_ATTIC = 26
|
||||
.equ RESSSOURCE_IMG_RESET = 27
|
||||
.equ RESSSOURCE_IMG_DEBUGEEPROM = 28
|
||||
|
||||
.equ RESSSOURCE_TXT_CO2_S = 29
|
||||
.equ RESSSOURCE_TXT_TEMP_S = 30
|
||||
.equ RESSSOURCE_TXT_HUM_S = 31
|
||||
.equ RESSSOURCE_TXT_UNKNOWN_S = 32
|
||||
.equ RESSSOURCE_TXT_ROOMCLIMATE = 33
|
||||
.equ RESSSOURCE_TXT_AQHOME = 34
|
||||
.equ RESSSOURCE_TXT_PACKETSIN = 35
|
||||
.equ RESSSOURCE_TXT_PACKETSOUT = 36
|
||||
.equ RESSSOURCE_TXT_ECONTENT = 37
|
||||
.equ RESSSOURCE_TXT_EMSGSIZE = 38
|
||||
.equ RESSSOURCE_TXT_EIO = 39
|
||||
.equ RESSSOURCE_TXT_NETSTATS = 40
|
||||
|
||||
|
||||
|
||||
|
||||
188
avr/devices/c03/main/w_climate.asm
Normal file
188
avr/devices/c03/main/w_climate.asm
Normal file
@@ -0,0 +1,188 @@
|
||||
; ***************************************************************************
|
||||
; 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_W_CLIMATE_ASM
|
||||
#define AQH_AVR_W_CLIMATE_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
.equ CLIMATEWIN_OFFS_BEGIN = MAINWINDOW_SIZE
|
||||
.equ CLIMATEWIN_SIZE = CLIMATEWIN_OFFS_BEGIN+0
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ClimateWin_new @global
|
||||
;
|
||||
; @param Y pointer to GUIAPP
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
|
||||
ClimateWin_new:
|
||||
bigcall GuiApp_GetRootWindow
|
||||
brcc ClimateWin_new_ret
|
||||
mov xl, r18 ; use root window as parent for main window
|
||||
mov xh, r19
|
||||
ldi r24, LOW(CLIMATEWIN_SIZE)
|
||||
ldi r25, HIGH(CLIMATEWIN_SIZE)
|
||||
bigcall Object_Alloc ; Y=space (!r16, !r17, !X)
|
||||
brcc ClimateWin_new_ret
|
||||
rcall ClimateWin_Init
|
||||
ClimateWin_new_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine ClimateWin_new @global
|
||||
;
|
||||
; @param Y pointer to newly allocated widget data
|
||||
; @param X pointer to root window
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @clobbers any, !Y
|
||||
|
||||
ClimateWin_Init:
|
||||
ldi r16, 0 ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, LOW(RESSSOURCE_TXT_ROOMCLIMATE)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_ROOMCLIMATE)
|
||||
bigcall MainWindow_new ; Y=main window
|
||||
brcc ClimateWin_Init_ret
|
||||
|
||||
bigcall MainWindow_GetContentWidget ; r19:r18=content window
|
||||
brcc ClimateWin_Init_ret
|
||||
mov xl, r18 ; use content window as parent
|
||||
mov xh, r19
|
||||
|
||||
; Y=MainWindow
|
||||
push yl ; main window
|
||||
push yh
|
||||
push xl ; content window
|
||||
push xh
|
||||
rcall climateWinCreateSensorWatches
|
||||
pop xh ; content window
|
||||
pop xl
|
||||
bigcall C03App_CreateBackButton
|
||||
pop yh ; main window
|
||||
pop yl
|
||||
ClimateWin_Init_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine climateWinCreateSensorWatches
|
||||
;
|
||||
; @param X pointer to MainWindow content window (becomes parent)
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
|
||||
climateWinCreateSensorWatches:
|
||||
ldi r16, 0 ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, HLAYOUT_MODE_SPREAD
|
||||
bigcall HLayout_new
|
||||
brcc climateWinCreateSensorWatches_ret
|
||||
|
||||
ldi r16, LOW(ClimateWindow_HLayoutStyle*2)
|
||||
std Y+WIDGET_OFFS_STYLE_LO, r16
|
||||
ldi r16, HIGH(ClimateWindow_HLayoutStyle*2)
|
||||
std Y+WIDGET_OFFS_STYLE_HI, r16
|
||||
|
||||
mov xl, yl ; use HLayout as parent
|
||||
mov xh, yh
|
||||
|
||||
; CO2 sensor watch
|
||||
push xl ; HLayout
|
||||
push xh
|
||||
ldi r16, (1<<OBJECT_OPTS_TIMER_BIT) | \
|
||||
(1<<WIDGET_OPTS_INPUT_BIT) | \
|
||||
(1<<OBJECT_OPTS_MSGRECV_BIT) ; OPTS
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | \
|
||||
(WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, VALUE_ID_SENSOR_CO2_BASE
|
||||
ldi r21, C03_EEID_SENSOR_CO2
|
||||
ldi r22, SENSORWATCH_TYPE_CO2
|
||||
bigcall SensorWatch_new
|
||||
pop xh
|
||||
pop xl
|
||||
brcc climateWinCreateSensorWatches_ret
|
||||
|
||||
; temp sensor watch
|
||||
push xl ; HLayout
|
||||
push xh
|
||||
ldi r16, (1<<OBJECT_OPTS_TIMER_BIT) | \
|
||||
(1<<WIDGET_OPTS_INPUT_BIT) | \
|
||||
(1<<OBJECT_OPTS_MSGRECV_BIT); OPTS
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | \
|
||||
(WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, VALUE_ID_SENSOR_TEMP_BASE
|
||||
ldi r21, C03_EEID_SENSOR_TEMP
|
||||
ldi r22, SENSORWATCH_TYPE_TEMP
|
||||
bigcall SensorWatch_new
|
||||
pop xh
|
||||
pop xl
|
||||
brcc climateWinCreateSensorWatches_ret
|
||||
|
||||
; humidity sensor watch
|
||||
push xl ; HLayout
|
||||
push xh
|
||||
ldi r16, (1<<OBJECT_OPTS_TIMER_BIT) | \
|
||||
(1<<WIDGET_OPTS_INPUT_BIT) | \
|
||||
(1<<OBJECT_OPTS_MSGRECV_BIT); OPTS
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | \
|
||||
(WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, VALUE_ID_SENSOR_HUM_BASE
|
||||
ldi r21, C03_EEID_SENSOR_HUM
|
||||
ldi r22, SENSORWATCH_TYPE_HUM
|
||||
bigcall SensorWatch_new
|
||||
pop xh
|
||||
pop xl
|
||||
|
||||
climateWinCreateSensorWatches_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in FLASH
|
||||
|
||||
|
||||
ClimateWindow_HLayoutStyle:
|
||||
.dw DISPLAY_COLOR_BLACK ; frontCol_norm
|
||||
.dw DISPLAY_COLOR_LIGHTGREY ; backCol_norm
|
||||
.dw DISPLAY_COLOR_BLACK ; borderCol_norm
|
||||
.dw DISPLAY_COLOR_WHITE ; shadowCol_norm
|
||||
|
||||
.dw DISPLAY_COLOR_WHITE ; frontCol_activated
|
||||
.dw DISPLAY_COLOR_NAVY ; backCol_activated
|
||||
.dw DISPLAY_COLOR_BLACK ; borderCol_activated
|
||||
.dw DISPLAY_COLOR_WHITE ; shadowCol_activated
|
||||
|
||||
.db 0, 1 ; outerBorderSize, innerBorderSize
|
||||
.dw ili9341Font12x16_1*2 ; font
|
||||
.db 12, 16 ; charWidth, charHeight
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
267
avr/devices/c03/main/w_menu.asm
Normal file
267
avr/devices/c03/main/w_menu.asm
Normal file
@@ -0,0 +1,267 @@
|
||||
; ***************************************************************************
|
||||
; 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_W_MENU_ASM
|
||||
#define AQH_AVR_W_MENU_ASM
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
.equ MENUWIN_OFFS_BEGIN = MAINWINDOW_SIZE
|
||||
.equ MENUWIN_SIZE = MENUWIN_OFFS_BEGIN+0
|
||||
|
||||
|
||||
.equ MENUWIN_SIGNAL_CLIMATE = WIDGET_SIGNAL_NEXTFREE+0
|
||||
.equ MENUWIN_SIGNAL_LIGHT = WIDGET_SIGNAL_NEXTFREE+1
|
||||
.equ MENUWIN_SIGNAL_WINDOWS = WIDGET_SIGNAL_NEXTFREE+2
|
||||
.equ MENUWIN_SIGNAL_DEBUG = WIDGET_SIGNAL_NEXTFREE+3
|
||||
.equ MENUWIN_SIGNAL_NETSTATS = WIDGET_SIGNAL_NEXTFREE+4
|
||||
.equ MENUWIN_SIGNAL_NEXTFREE = WIDGET_SIGNAL_NEXTFREE+5
|
||||
|
||||
|
||||
.equ MENUWIN_SEL_CLIMATE = 1
|
||||
.equ MENUWIN_SEL_LIGHT = 2
|
||||
.equ MENUWIN_SEL_WINDOWS = 3
|
||||
.equ MENUWIN_SEL_DEBUG = 4
|
||||
.equ MENUWIN_SEL_NETSTATS = 5
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_new @global
|
||||
;
|
||||
; @param Y pointer to GUIAPP
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
|
||||
MenuWin_new:
|
||||
bigcall GuiApp_GetRootWindow
|
||||
brcc MenuWin_new_ret
|
||||
mov xl, r18 ; use root window as parent for main window
|
||||
mov xh, r19
|
||||
|
||||
ldi r16, 0 ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, LOW(RESSSOURCE_TXT_AQHOME)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_AQHOME)
|
||||
bigcall MainWindow_new
|
||||
brcc MenuWin_new_ret
|
||||
|
||||
; set default signal map
|
||||
ldi r16, LOW(MenuWin_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_LO, r16
|
||||
ldi r16, HIGH(MenuWin_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_HI, r16
|
||||
|
||||
|
||||
; Y=MainWindow
|
||||
push yl
|
||||
push yh
|
||||
bigcall MainWindow_GetContentWidget ; r19:r18=content window
|
||||
brcc MenuWin_new_popRet
|
||||
mov xl, r18 ; use content window as parent
|
||||
mov xh, r19
|
||||
|
||||
push xl ; content window
|
||||
push xh
|
||||
rcall menuWinCreateContent
|
||||
pop xh
|
||||
pop xl
|
||||
MenuWin_new_popRet:
|
||||
pop yh
|
||||
pop yl
|
||||
MenuWin_new_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine menuWinCreateContent
|
||||
;
|
||||
; @param Y pointer to MainWindow
|
||||
; @param X pointer to MainWindow content window (becomes parent)
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
|
||||
menuWinCreateContent:
|
||||
; create MLayout
|
||||
push yl
|
||||
push yh
|
||||
ldi r16, 0 ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, 5 ; columns per row
|
||||
bigcall MCLayout_new
|
||||
mov xl, yl ; use MLayout as parent
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_IMG_TEMP)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_TEMP)
|
||||
ldi r22, MENUWIN_SEL_CLIMATE
|
||||
rcall menuWinCreateButton
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_IMG_LIGHT)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_LIGHT)
|
||||
ldi r22, MENUWIN_SEL_LIGHT
|
||||
rcall menuWinCreateButton
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_IMG_WINCLOSED)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_WINCLOSED)
|
||||
ldi r22, MENUWIN_SEL_WINDOWS
|
||||
rcall menuWinCreateButton
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_IMG_NETWORK)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_NETWORK)
|
||||
ldi r22, MENUWIN_SEL_NETSTATS
|
||||
rcall menuWinCreateButton
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_IMG_DEBUGEEPROM)
|
||||
ldi r21, HIGH(RESSSOURCE_IMG_DEBUGEEPROM)
|
||||
ldi r22, MENUWIN_SEL_DEBUG
|
||||
rcall menuWinCreateButton
|
||||
brcc menuWinCreateContent_ret
|
||||
|
||||
mov yl, xl
|
||||
mov yh, xh
|
||||
sec
|
||||
menuWinCreateContent_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine menuWinCreateButton
|
||||
;
|
||||
; @param Y pointer to MainWindow
|
||||
; @param X parent
|
||||
; @param r21:r20 img ressource
|
||||
; @param r22 selector
|
||||
; @return CFLAG set if new object created, cleared on error
|
||||
; @clobbers any, !X, !Y
|
||||
|
||||
menuWinCreateButton:
|
||||
push xl
|
||||
push xh
|
||||
push yl
|
||||
push yh
|
||||
ldi r16, 0
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
bigcall C03App_CreateButton
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc menuWinCreateButton_popRet
|
||||
adiw xh:xl, OBJECT_OFFS_TARGET_LO
|
||||
st X+, yl
|
||||
st X, yh
|
||||
sbiw xh:xl, (OBJECT_OFFS_TARGET_LO+1)
|
||||
sec
|
||||
menuWinCreateButton_popRet:
|
||||
pop xh
|
||||
pop xl
|
||||
menuWinCreateButton_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_OnCmdClimate
|
||||
|
||||
MenuWin_OnCmdClimate:
|
||||
ldi r16, MENUWIN_SIGNAL_CLIMATE
|
||||
bigcall OBJ_EmitSignal
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_OnCmdLight
|
||||
|
||||
MenuWin_OnCmdLight:
|
||||
ldi r16, MENUWIN_SIGNAL_LIGHT
|
||||
bigcall OBJ_EmitSignal
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_OnCmdWindows
|
||||
|
||||
MenuWin_OnCmdWindows:
|
||||
ldi r16, MENUWIN_SIGNAL_WINDOWS
|
||||
bigcall OBJ_EmitSignal
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_OnCmdNetStats
|
||||
|
||||
MenuWin_OnCmdNetStats:
|
||||
ldi r16, MENUWIN_SIGNAL_NETSTATS
|
||||
bigcall OBJ_EmitSignal
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine MenuWin_OnCmdDebug
|
||||
|
||||
MenuWin_OnCmdDebug:
|
||||
ldi r16, MENUWIN_SIGNAL_DEBUG
|
||||
bigcall OBJ_EmitSignal
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in FLASH
|
||||
|
||||
MenuWin_DefaultSignalmap:
|
||||
; header
|
||||
.dw MainWindow_DefaultSignalmap*2 ; next table to use
|
||||
; entries
|
||||
.db MENUWIN_SEL_CLIMATE, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdClimate), HIGH(MenuWin_OnCmdClimate)
|
||||
.db MENUWIN_SEL_LIGHT, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdLight), HIGH(MenuWin_OnCmdLight)
|
||||
.db MENUWIN_SEL_WINDOWS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdWindows), HIGH(MenuWin_OnCmdWindows)
|
||||
.db MENUWIN_SEL_NETSTATS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdNetStats), HIGH(MenuWin_OnCmdNetStats)
|
||||
.db MENUWIN_SEL_DEBUG, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdDebug), HIGH(MenuWin_OnCmdDebug)
|
||||
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
363
avr/devices/c03/main/w_netstats.asm
Normal file
363
avr/devices/c03/main/w_netstats.asm
Normal file
@@ -0,0 +1,363 @@
|
||||
; ***************************************************************************
|
||||
; 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_NETSTATS_ASM
|
||||
#define AQH_AVR_GUI2_NETSTATS_ASM
|
||||
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
|
||||
.equ NETSTATWIN_OFFS_BEGIN = MAINWINDOW_SIZE
|
||||
.equ NETSTATWIN_OFFS_TIMER = NETSTATWIN_OFFS_BEGIN+0
|
||||
.equ NETSTATWIN_SIZE = NETSTATWIN_OFFS_BEGIN+1
|
||||
|
||||
|
||||
.equ NETSTATWIN_TIMERVAL = 50 ; update every 5 secs
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine NetStatWin_new @global
|
||||
;
|
||||
; @param Y pointer to GUIAPP
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
|
||||
NetStatWin_new:
|
||||
bigcall GuiApp_GetRootWindow
|
||||
brcc NetStatWin_new_ret
|
||||
mov xl, r18 ; use root window as parent for main window
|
||||
mov xh, r19
|
||||
ldi r24, LOW(NETSTATWIN_SIZE)
|
||||
ldi r25, HIGH(NETSTATWIN_SIZE)
|
||||
bigcall Object_Alloc ; Y=space (!r16, !r17, !X)
|
||||
brcc NetStatWin_new_ret
|
||||
rcall NetStatWin_Init
|
||||
NetStatWin_new_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine NetStatWin_new @global
|
||||
;
|
||||
; @param Y pointer to newly allocated widget data
|
||||
; @param X pointer to root window
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @clobbers any, !Y
|
||||
|
||||
NetStatWin_Init:
|
||||
ldi r16, (1<<OBJECT_OPTS_TIMER_BIT) ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, LOW(RESSSOURCE_TXT_NETSTATS)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_NETSTATS)
|
||||
bigcall MainWindow_Init ; (any, !Y)
|
||||
brcc NetStatWin_Init_ret
|
||||
|
||||
; set default signal map
|
||||
ldi r16, LOW(NetStatWin_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_LO, r16
|
||||
ldi r16, HIGH(NetStatWin_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_HI, r16
|
||||
|
||||
; set timer
|
||||
ldi r16, NETSTATWIN_TIMERVAL
|
||||
std Y+NETSTATWIN_OFFS_TIMER, r16
|
||||
|
||||
bigcall MainWindow_GetContentWidget ; r19:r18=content window
|
||||
brcc NetStatWin_Init_ret
|
||||
mov xl, r18 ; use content window as parent
|
||||
mov xh, r19
|
||||
|
||||
; Y=MainWindow
|
||||
push yl
|
||||
push yh
|
||||
push xl ; content window
|
||||
push xh
|
||||
rcall netStatWinCreateContent
|
||||
pop xh
|
||||
pop xl
|
||||
bigcall C03App_CreateBackButton
|
||||
pop yh
|
||||
pop yl
|
||||
NetStatWin_Init_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
NetStatWin_OnTimer:
|
||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||
andi r16, (1<<WIDGET_FLAGS_VISIBLE_BIT)
|
||||
breq NetStatWin_OnTimer_ret
|
||||
|
||||
ldd r16, Y+NETSTATWIN_OFFS_TIMER
|
||||
tst r16
|
||||
breq NetStatWin_OnTimer_ret
|
||||
dec r16
|
||||
std Y+NETSTATWIN_OFFS_TIMER, r16
|
||||
brne NetStatWin_OnTimer_ret
|
||||
push yl
|
||||
push yh
|
||||
rcall netStatWinUpdate
|
||||
pop yh
|
||||
pop yl
|
||||
ldi r16, NETSTATWIN_TIMERVAL
|
||||
std Y+NETSTATWIN_OFFS_TIMER, r16
|
||||
NetStatWin_OnTimer_ret:
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
NetStatWin_OnShow:
|
||||
bigcall Widget_OnShow
|
||||
push yl
|
||||
push yh
|
||||
rcall netStatWinUpdate
|
||||
pop yh
|
||||
pop yl
|
||||
; reset timer
|
||||
ldi r16, NETSTATWIN_TIMERVAL
|
||||
std Y+NETSTATWIN_OFFS_TIMER, r16
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine netStatWinCreateContent
|
||||
;
|
||||
; @param Y pointer to MainWindow
|
||||
; @param X pointer to MainWindow content window (becomes parent)
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
|
||||
netStatWinCreateContent:
|
||||
; create MLayout
|
||||
ldi r16, 0 ; OPTS
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||
ldi r20, 2 ; columns per row
|
||||
bigcall MCLayout_new
|
||||
brcc netStatWinCreateContent_ret
|
||||
|
||||
mov xl, yl ; use MLayout as parent
|
||||
mov xh, yh
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_TXT_PACKETSIN)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSIN)
|
||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||
brcc netStatWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_TXT_PACKETSOUT)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_PACKETSOUT)
|
||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||
brcc netStatWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_TXT_ECONTENT)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_ECONTENT)
|
||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||
brcc netStatWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_TXT_EIO)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_EIO)
|
||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||
brcc netStatWinCreateContent_ret
|
||||
|
||||
ldi r20, LOW(RESSSOURCE_TXT_EMSGSIZE)
|
||||
ldi r21, HIGH(RESSSOURCE_TXT_EMSGSIZE)
|
||||
rcall netStatWinCreateWidgetPair ; (any, !X, !Y)
|
||||
|
||||
netStatWinCreateContent_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine netStatWinCreateWidgetPair
|
||||
;
|
||||
; @param X parent
|
||||
; @param r21:r20 id of text ressource
|
||||
; @return CFLAG set if created, cleared otherwise
|
||||
; @clobbers !X, !Y
|
||||
|
||||
netStatWinCreateWidgetPair:
|
||||
push yl
|
||||
push yh
|
||||
rcall netStatWinCreateLabel ; (any, !X)
|
||||
brcc netStatWinCreateWidgetPair_popRet
|
||||
rcall netStatWinCreateValueLabel ; (any, !X)
|
||||
netStatWinCreateWidgetPair_popRet:
|
||||
pop yh
|
||||
pop yl
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine netStatWinCreateLabel
|
||||
;
|
||||
; @param X parent
|
||||
; @param r21:r20 id of text ressource
|
||||
; @return CFLAG set if created, cleared otherwise
|
||||
; @return Y new object created
|
||||
; @clobbers !X
|
||||
|
||||
netStatWinCreateLabel:
|
||||
push xl
|
||||
push xh
|
||||
ldi r16, 0
|
||||
ldi r17, (WIDGET_PACK_BEGIN<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_CENTER<<WIDGET_PACK_VSELF0_BIT) | \
|
||||
(WIDGET_PACK_BEGIN<<WIDGET_PACK_HCONTENT0_BIT) | (WIDGET_PACK_CENTER<<WIDGET_PACK_VCONTENT0_BIT)
|
||||
bigcall Label_new
|
||||
pop xh
|
||||
pop xl
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine netStatWinCreateValueLabel
|
||||
;
|
||||
; @param X parent (content sub-window of main window)
|
||||
; @param r21:r20 id of text ressource
|
||||
; @return CFLAG set if created, cleared otherwise
|
||||
; @return Y new object created
|
||||
; @clobbers !X
|
||||
|
||||
netStatWinCreateValueLabel:
|
||||
push xl
|
||||
push xh
|
||||
ldi r16, 0
|
||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_CENTER<<WIDGET_PACK_VSELF0_BIT) | \
|
||||
(WIDGET_PACK_END<<WIDGET_PACK_HCONTENT0_BIT) | (WIDGET_PACK_CENTER<<WIDGET_PACK_VCONTENT0_BIT)
|
||||
clr r20
|
||||
bigcall ValueLabel_new
|
||||
pop xh
|
||||
pop xl
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine netStatWinUpdate
|
||||
;
|
||||
; @param Y pointer to window
|
||||
; @clobbers any
|
||||
|
||||
netStatWinUpdate:
|
||||
bigcall MainWindow_GetFirstChildOfContentWidget ; get MLayout
|
||||
brcc netStatWinUpdate_ret
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall OBJ_GetFirstChild ; get first child widget (label)
|
||||
brcc netStatWinUpdate_ret
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall OBJ_GetNext ; get first value label widget
|
||||
brcc netStatWinUpdate_ret
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
|
||||
rcall netWinStatsUpdatePacketsIn
|
||||
brcc netStatWinUpdate_ret
|
||||
rcall netWinStatsUpdatePacketsOut
|
||||
brcc netStatWinUpdate_ret
|
||||
rcall netWinStatsUpdateContentErrors
|
||||
brcc netStatWinUpdate_ret
|
||||
rcall netWinStatsUpdateIoErrors
|
||||
brcc netStatWinUpdate_ret
|
||||
rcall netWinStatsUpdateMsgSizeErrors
|
||||
netStatWinUpdate_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
netWinStatsUpdatePacketsIn:
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_PACKETSIN_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_PACKETSIN_HIGH
|
||||
bigcall ValueLabel_SetValue
|
||||
rjmp netWinStatsSkip2
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
netWinStatsUpdatePacketsOut:
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_PACKETSOUT_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_PACKETSOUT_HIGH
|
||||
bigcall ValueLabel_SetValue
|
||||
rjmp netWinStatsSkip2
|
||||
; @end
|
||||
|
||||
|
||||
netWinStatsUpdateContentErrors:
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_CONTENT_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_CONTENT_HIGH
|
||||
bigcall ValueLabel_SetValue
|
||||
rjmp netWinStatsSkip2
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
netWinStatsUpdateIoErrors:
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_IO_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_IO_HIGH
|
||||
bigcall ValueLabel_SetValue
|
||||
rjmp netWinStatsSkip2
|
||||
; @end
|
||||
|
||||
|
||||
netWinStatsUpdateMsgSizeErrors:
|
||||
lds xl, netInterfaceData+NET_IFACE_OFFS_ERR_MSGSIZE_LOW
|
||||
lds xh, netInterfaceData+NET_IFACE_OFFS_ERR_MSGSIZE_HIGH
|
||||
bigcall ValueLabel_SetValue
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
netWinStatsSkip2:
|
||||
ldi r16, 2
|
||||
bigcall OBJ_SkipObjects
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data in FLASH
|
||||
|
||||
NetStatWin_DefaultSignalmap:
|
||||
; header
|
||||
.dw MainWindow_DefaultSignalmap*2 ; next table to use
|
||||
; entries
|
||||
.db 0, OBJECT_SIGNAL_TIMER, LOW(NetStatWin_OnTimer), HIGH(NetStatWin_OnTimer)
|
||||
.db 0, WIDGET_SIGNAL_SHOW, LOW(NetStatWin_OnShow), HIGH(NetStatWin_OnShow)
|
||||
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user