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:
@@ -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
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user