From d713e774ee8b23f045c6c3570122c8e11833cad7 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Fri, 8 May 2026 00:29:00 +0200 Subject: [PATCH] gui: added Widget_GetCurrentValue, Widget_GetMinValue, Widget_GetMaxValue --- avr/modules/lcd2/gui/base/widget.asm | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/avr/modules/lcd2/gui/base/widget.asm b/avr/modules/lcd2/gui/base/widget.asm index c251e84..322bd68 100644 --- a/avr/modules/lcd2/gui/base/widget.asm +++ b/avr/modules/lcd2/gui/base/widget.asm @@ -392,6 +392,21 @@ Widget_SetCurrentValue: +; --------------------------------------------------------------------------- +; @routine Widget_GetCurrentValue @global +; +; @param Y address of widget +; @param X value to set +; @return CFLAG set if value set, cleared on error +; @clobbers any, !Y + +Widget_GetCurrentValue: + ldi r17, WIDGET_VALUE_CURRENTVALUE + bigjmp widgetGetValueOrZero +; @end + + + ; --------------------------------------------------------------------------- ; @routine Widget_SetMinValue @global ; @@ -408,6 +423,20 @@ Widget_SetMinValue: +; --------------------------------------------------------------------------- +; @routine Widget_GetMinValue @global +; +; @param Y address of widget +; @return CFLAG set if value set, cleared on error +; @clobbers any, !Y + +Widget_GetMinValue: + ldi r17, WIDGET_VALUE_CURRENTVALUE + bigjmp widgetGetValueOrZero +; @end + + + ; --------------------------------------------------------------------------- ; @routine Widget_SetMaxValue @global ; @@ -424,6 +453,39 @@ Widget_SetMaxValue: +; --------------------------------------------------------------------------- +; @routine Widget_GetMaxValue @global +; +; @param Y address of widget +; @return CFLAG set if value set, cleared on error +; @clobbers any, !Y + +Widget_GetMaxValue: + ldi r17, WIDGET_VALUE_MAXVALUE + bigjmp widgetGetValueOrZero +; @end + + + +; --------------------------------------------------------------------------- +; @routine widgetGetValueOrZero @global +; +; @param Y address of widget +; @param r17 value id to get +; @return CFLAG set if value set, cleared on error +; @clobbers any, !Y + +widgetGetValueOrZero: + ldi r16, WIDGET_SIGNAL_GETVALUE + bigcall OBJ_HandleSignal + brcs widgetGetValueOrZero_ret + clr r18 + clr r19 +widgetGetValueOrZero_ret: +; @end + + + ; --------------------------------------------------------------------------- ; @routine Widget_IsPointInRect @global ;