From 34176ea2ed65d967dd6eb7adf104a714001d4ae9 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Sun, 18 Jan 2026 14:27:51 +0100 Subject: [PATCH] c03: use complete SensorWatch for CO2. --- avr/devices/c03/main/main.asm | 2 ++ avr/devices/c03/main/testwin.asm | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/avr/devices/c03/main/main.asm b/avr/devices/c03/main/main.asm index d34ba8f..2ec46b2 100644 --- a/avr/devices/c03/main/main.asm +++ b/avr/devices/c03/main/main.asm @@ -281,6 +281,7 @@ test: ;.include "common/list_t.asm" ;.include "common/tree_t.asm" .include "common/divide.asm" +.include "common/itoa.asm" .include "common/ressource.asm" .include "style.asm" @@ -290,6 +291,7 @@ test: .include "modules/lcd2/gui2/label.asm" .include "modules/lcd2/gui2/imageview.asm" .include "modules/lcd2/gui2/sensorwatch.asm" +.include "modules/lcd2/gui2/valuelabel.asm" .include "modules/lcd2/gui2/guiapp.asm" .include "testwin.asm" diff --git a/avr/devices/c03/main/testwin.asm b/avr/devices/c03/main/testwin.asm index b7b2f16..6d635e5 100644 --- a/avr/devices/c03/main/testwin.asm +++ b/avr/devices/c03/main/testwin.asm @@ -46,6 +46,8 @@ winSensorWatch1Title_ramdata: winSensorWatch1Image_ramdata: .byte IMGVIEW_SD_SIZE +winSensorWatch1Value_ramdata: + .byte VLABEL_SD_SIZE @@ -255,7 +257,7 @@ winSensorWatch1Title_signalmap: winSensorWatch1Image: ; OBJECT .db 0x55, 0xaa ; magic - .dw 0 ; next + .dw winSensorWatch1Value*2 ; next .dw winSensorWatch1*2 ; parent .dw 0 ; first child .dw 0 ; target @@ -281,6 +283,34 @@ winSensorWatch1Image_signalmap: .db 0, 0, 0, 0 ; end of table +winSensorWatch1Value: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw 0 ; next + .dw winSensorWatch1*2 ; parent + .dw 0 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw winSensorWatch1Value_signalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 2 ; X + .dw STYLE_WIN_FONT_HEIGHT+2+96+2 ; 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 winSensorWatch1Value_ramdata ; ptr to SDRAM + ; VALUELABEL + .db 0, 0 ; num of post-komma digits + + +winSensorWatch1Value_signalmap: + .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) + .db 0, WIDGET_SIGNAL_DRAW, LOW(ValueLabel_OnDraw), HIGH(ValueLabel_OnDraw) + .db 0, VLABEL_SIGNAL_SETVALUE, LOW(ValueLabel_OnSetValue), HIGH(ValueLabel_OnSetValue) + .db 0, 0, 0, 0 ; end of table