avr: added titled windows
This commit is contained in:
@@ -247,6 +247,7 @@
|
||||
|
||||
#ifdef MODULES_ILI9341
|
||||
.include "modules/lcd2/ili9341/defs.asm"
|
||||
.include "modules/lcd2/ili9341/colors.asm"
|
||||
.include "modules/lcd2/ili9341/main.asm"
|
||||
.include "modules/lcd2/ili9341/io_spi.asm"
|
||||
.include "modules/lcd2/ili9341/graphops.asm"
|
||||
|
||||
@@ -213,6 +213,14 @@ onEveryLoop:
|
||||
|
||||
|
||||
|
||||
test:
|
||||
#ifdef MODULES_GUI
|
||||
bigcall WinNetStats_Init
|
||||
#endif
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
@@ -223,6 +231,7 @@ onEveryLoop:
|
||||
|
||||
;.include "common/debug.asm"
|
||||
|
||||
.include "modules/lcd2/gui/titledwindow.asm"
|
||||
;.include "modules/lcd2/font/font2.asm"
|
||||
;.include "modules/lcd2/font/font3.asm"
|
||||
;.include "modules/lcd2/font/font16x26.asm"
|
||||
@@ -234,6 +243,9 @@ onEveryLoop:
|
||||
;.include "common/tree_t.asm"
|
||||
;.include "common/divide.asm"
|
||||
|
||||
.include "modules/lcd2/gui/style.asm"
|
||||
.include "win_netstats.asm"
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; defines for network interface
|
||||
@@ -245,93 +257,9 @@ onEveryLoop:
|
||||
|
||||
|
||||
|
||||
test:
|
||||
#ifdef MODULES_GUI
|
||||
ldi yl, LOW(mainWindow)
|
||||
ldi yh, HIGH(mainWindow)
|
||||
ldi zl, LOW(mainWindowInFlash*2);
|
||||
ldi zh, HIGH(mainWindowInFlash*2);
|
||||
ldi r17, WIN_SIZE
|
||||
testCopyWinLoop:
|
||||
lpm r16, Z+
|
||||
st Y+, r16
|
||||
dec r17
|
||||
brne testCopyWinLoop
|
||||
|
||||
ldi yl, LOW(mainWindow)
|
||||
ldi yh, HIGH(mainWindow)
|
||||
bigcall Window_Clear
|
||||
#if 1
|
||||
ldi zl, LOW(mainWindowTitle*2)
|
||||
ldi zh, HIGH(mainWindowTitle*2)
|
||||
; print title at 10/2
|
||||
ldi r16, 10
|
||||
mov r4, r16
|
||||
clr r5
|
||||
ldi r16, 2
|
||||
mov r6, r16
|
||||
clr r7
|
||||
bigcall Window_DrawTextFlash
|
||||
#else
|
||||
ldi zl, LOW(ili9341Font6x8_1*2)
|
||||
ldi zh, HIGH(ili9341Font6x8_1*2)
|
||||
|
||||
ldi r16, LOW(0b0000000000000000)
|
||||
mov r0, r16
|
||||
ldi r16, HIGH(0b0000000000000000)
|
||||
mov r1, r16
|
||||
|
||||
ldi r16, LOW(0b1111111111111111)
|
||||
mov r2, r16
|
||||
ldi r16, HIGH(0b1111111111111111)
|
||||
mov r3, r16
|
||||
|
||||
ldi r16, 10
|
||||
mov r4, r16
|
||||
clr r5
|
||||
ldi r16, 20
|
||||
mov r6, r16
|
||||
clr r7
|
||||
|
||||
ldi r16, 'A'
|
||||
bigcall Display_DrawChar
|
||||
|
||||
add r4, r18
|
||||
adc r5, r19
|
||||
|
||||
ldi r16, 'B'
|
||||
bigcall Display_DrawChar
|
||||
|
||||
#endif
|
||||
ret
|
||||
|
||||
|
||||
testHandler:
|
||||
ret
|
||||
|
||||
|
||||
#ifdef MODULES_GUI
|
||||
mainWindowInFlash:
|
||||
.dw testHandler ; handler
|
||||
.dw 0 ; X
|
||||
.dw 0 ; Y
|
||||
.dw DISPLAY_WIDTH
|
||||
.dw DISPLAY_HEIGHT
|
||||
; 0bRRRRRGGGGGGBBBBB
|
||||
.dw 0b0000000000011111 ; blue
|
||||
; .dw 0b1111100000000000 ; red
|
||||
.dw 0b1111111111111111 ; white
|
||||
.dw (ili9341Font6x8_1*2)
|
||||
|
||||
mainWindowTitle: .db "AQHOME", 0, 0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
.dseg
|
||||
|
||||
mainWindow: .byte WIN_SIZE
|
||||
|
||||
heapStart:
|
||||
|
||||
|
||||
|
||||
67
avr/devices/c02/main/win_netstats.asm
Normal file
67
avr/devices/c02/main/win_netstats.asm
Normal file
@@ -0,0 +1,67 @@
|
||||
; ***************************************************************************
|
||||
; 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. *
|
||||
; ***************************************************************************
|
||||
|
||||
#ifndef AQH_AVR_DEVICE_C02_WIN_NETSTATS_ASM
|
||||
#define AQH_AVR_DEVICE_C02_WIN_NETSTATS_ASM
|
||||
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
WinNetStats_Init:
|
||||
; setup
|
||||
ldi yl, LOW(winNetstats)
|
||||
ldi yh, HIGH(winNetstats)
|
||||
rcall TitleWindow_Init
|
||||
|
||||
ldi zl, LOW(ili9341Font6x8_1*2)
|
||||
ldi zh, HIGH(ili9341Font6x8_1*2)
|
||||
bigcall TitleWindow_SetFont
|
||||
|
||||
ldi r16, LOW(winNetstats_title*2)
|
||||
std Y+TITLEDWINDOW_OFFS_TITLEPTR_LO, r16
|
||||
ldi r16, HIGH(winNetstats_title*2)
|
||||
std Y+TITLEDWINDOW_OFFS_TITLEPTR_HI, r16
|
||||
|
||||
; setup size and pos
|
||||
clr r4
|
||||
clr r5
|
||||
clr r6
|
||||
clr r7
|
||||
ldi r16, LOW(DISPLAY_WIDTH)
|
||||
mov r8, r16
|
||||
ldi r16, HIGH(DISPLAY_WIDTH)
|
||||
mov r9, r16
|
||||
ldi r16, LOW(DISPLAY_HEIGHT)
|
||||
mov r10, r16
|
||||
ldi r16, HIGH(DISPLAY_HEIGHT)
|
||||
mov r11, r16
|
||||
bigcall TitleWindow_SetPosAndSize
|
||||
|
||||
; setup colors
|
||||
bigcall TitleWindow_SetStyleColors
|
||||
|
||||
bigcall TitleWindow_Draw
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
winNetstats_title: .db "Network Statistics", 0, 0
|
||||
|
||||
|
||||
|
||||
.dseg
|
||||
|
||||
winNetstats:
|
||||
.byte TITLEDWINDOW_SIZE
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user