avr: added widget SensorWatch

shows a pictogram for a sensor and changes background color according to
values received from a given sensor.
This commit is contained in:
Martin Preuss
2026-01-18 00:36:22 +01:00
parent 3009e9d0d0
commit 0443032de7
6 changed files with 486 additions and 84 deletions

View File

@@ -28,6 +28,11 @@
.equ IMGVIEW_SD_SIZE = IMGVIEW_SD_OFFS_IMGVIEW+2
; signals
.equ IMGVIEW_SIGNAL_SETBGCOL = WIDGET_SIGNAL_NEXTFREE+0
.equ IMGVIEW_SIGNAL_NEXTFREE = WIDGET_SIGNAL_NEXTFREE+1
; ***************************************************************************
; code
@@ -56,6 +61,34 @@ ImageView_OnCreate:
; ---------------------------------------------------------------------------
; @routine ImageView_OnSetBgCol @global
;
; @param Z byte address of widget object (for LPM!)
; @param X new value for background color
; @return CFLAG set if signal handled
; @clobbers r17
ImageView_OnSetBgCol:
bigcall OBJ_IsObject ; (none)
brcc ImageView_OnSetBgCol_ret
push zl
push zh
rcall Widget_GetSdramPtr ; (none)
std Y+IMGVIEW_SD_OFFS_BGCOL_LO, xl
std Y+IMGVIEW_SD_OFFS_BGCOL_HI, xh
ldd r17, Y+WIDGET_SD_OFFS_FLAGS
ori r17, (1<<WIDGET_FLAGS_DIRTY_BIT)
std Y+WIDGET_SD_OFFS_FLAGS, r17
pop zh
pop zl
ImageView_OnSetBgCol_ret:
sec
ret
; @end
; ---------------------------------------------------------------------------
; @routine Widget_OnDraw @global
;