avr: completed SensorWatch (now also prints value)

This commit is contained in:
Martin Preuss
2026-01-18 14:27:29 +01:00
parent 64bc199753
commit 46afcb3ed1

View File

@@ -204,6 +204,7 @@ SensorWatch_OnMsgReceived_report:
std Y+SENSORWATCH_SD_OFFS_VALUE_HI, r19 std Y+SENSORWATCH_SD_OFFS_VALUE_HI, r19
; setup background color ; setup background color
rcall sensorWatchSetColor ; (any, !Y, !Z) rcall sensorWatchSetColor ; (any, !Y, !Z)
rcall sensorWatchSetValueLabel ; (any, !Y, !Z)
SensorWatch_OnMsgReceived_ret: SensorWatch_OnMsgReceived_ret:
sec sec
ret ret
@@ -240,31 +241,31 @@ SensorWatch_GetImageView_ret:
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; @routine SensorWatch_GetDataLabel @global ; @routine SensorWatch_GetValueLabel @global
; ;
; @param Z byte address of widget object (for LPM!) ; @param Z byte address of widget object (for LPM!)
; @return CFLAG set if widget found, cleared otherwise ; @return CFLAG set if widget found, cleared otherwise
; @return R19:R18 byte address pointer to image view (for LPM!) ; @return R19:R18 byte address pointer to image view (for LPM!)
; @clobbers none ; @clobbers none
SensorWatch_GetDataLabel: SensorWatch_GetValueLabel:
bigcall OBJ_IsObject ; (none) bigcall OBJ_IsObject ; (none)
brcc SensorWatch_GetDataLabel_ret brcc SensorWatch_GetValueLabel_ret
push zl push zl
push zh push zh
bigcall OBJ_GetFirstChild ; (none) bigcall OBJ_GetFirstChild ; (none)
brcc SensorWatch_GetDataLabel_done brcc SensorWatch_GetValueLabel_done
mov zl, r18 mov zl, r18
mov zh, r19 mov zh, r19
bigcall OBJ_GetNext ; 2nd child bigcall OBJ_GetNext ; 2nd child
brcc SensorWatch_GetDataLabel_done brcc SensorWatch_GetValueLabel_done
mov zl, r18 mov zl, r18
mov zh, r19 mov zh, r19
bigcall OBJ_GetNext ; 3nd child bigcall OBJ_GetNext ; 3nd child
SensorWatch_GetDataLabel_done: SensorWatch_GetValueLabel_done:
pop zh pop zh
pop zl pop zl
SensorWatch_GetDataLabel_ret: SensorWatch_GetValueLabel_ret:
ret ret
; @end ; @end
@@ -333,6 +334,33 @@ sensorWatchSetColor_ret:
; ---------------------------------------------------------------------------
; @routine sensorWatchSetValueLabel
;
; @param Z byte address of widget object (for LPM!)
; @param Y pointer to SDRAM data
; @clobbers any, !Y, !Z
sensorWatchSetValueLabel:
rcall SensorWatch_GetValueLabel ; (none)
brcc sensorWatchSetValueLabel_ret
push zl
push zh
mov zl, r18
mov zh, r19
ldd xl, Y+SENSORWATCH_SD_OFFS_VALUE_LO
ldd xh, Y+SENSORWATCH_SD_OFFS_VALUE_HI
ldi r16, VLABEL_SIGNAL_SETVALUE
clr r17
bigcall OBJ_HandleSignal ; (any, !X, !Y, !Z)
pop zh
pop zl
sensorWatchSetValueLabel_ret:
ret
; @end