forntoh / LcdMenu

Display navigable menu items on your LCD display 📟 with Arduino
https://lcdmenu.forntoh.dev
MIT License
170 stars 38 forks source link

Feature/refactor items #221

Closed ShishkinDmitriy closed 1 week ago

ShishkinDmitriy commented 1 week ago

I tried to rename methods from up/down/left/right into specific for item, something like more 'domain specific':

image

Also signature of process simplified and instead of Context pass only LcdMenu and char. All required dependencies (display and current screen) can be obtained from menu.

Also true/false result for process method is controlled inside process method. Also simplified repeated if's

Also need somehow separate value update and draw.

github-actions[bot] commented 1 week ago

Memory usage change @ 742f050660a8f163cea26f885da5fe3131d67b54

Board flash % RAM for global variables %
arduino:avr:uno :green_heart: -336 - -40 -1.04 - -0.12 :green_heart: -8 - -2 -0.39 - -0.1
Click for full report table Board|`examples/Basic`
flash|%|`examples/Basic`
RAM for global variables|%|`examples/Callbacks`
flash|%|`examples/Callbacks`
RAM for global variables|%|`examples/CharsetInput`
flash|%|`examples/CharsetInput`
RAM for global variables|%|`examples/DigitalInputAdapter`
flash|%|`examples/DigitalInputAdapter`
RAM for global variables|%|`examples/DigitalInputWithRotaryAdapter`
flash|%|`examples/DigitalInputWithRotaryAdapter`
RAM for global variables|%|`examples/InputRotary`
flash|%|`examples/InputRotary`
RAM for global variables|%|`examples/IntFloatValues`
flash|%|`examples/IntFloatValues`
RAM for global variables|%|`examples/ItemBack`
flash|%|`examples/ItemBack`
RAM for global variables|%|`examples/KeyboardAdapter`
flash|%|`examples/KeyboardAdapter`
RAM for global variables|%|`examples/List`
flash|%|`examples/List`
RAM for global variables|%|`examples/MenuTimeout`
flash|%|`examples/MenuTimeout`
RAM for global variables|%|`examples/RTOS`
flash|%|`examples/RTOS`
RAM for global variables|%|`examples/SimpleInput`
flash|%|`examples/SimpleInput`
RAM for global variables|%|`examples/SimpleRotary`
flash|%|`examples/SimpleRotary`
RAM for global variables|%|`examples/SubMenu`
flash|%|`examples/SubMenu`
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- `arduino:avr:uno`|-44|-0.14|-2|-0.1|-52|-0.16|-4|-0.2|-300|-0.93|-4|-0.2|-40|-0.12|-4|-0.2|-336|-1.04|-8|-0.39|-328|-1.02|-8|-0.39|-128|-0.4|-4|-0.2|-72|-0.22|-6|-0.29|-300|-0.93|-4|-0.2|-118|-0.37|-4|-0.2|-44|-0.14|-2|-0.1|-72|-0.22|-6|-0.29|-146|-0.45|-4|-0.2|-188|-0.58|-8|-0.39|-64|-0.2|-4|-0.2
Click for full report CSV ``` Board,examples/Basic
flash,%,examples/Basic
RAM for global variables,%,examples/Callbacks
flash,%,examples/Callbacks
RAM for global variables,%,examples/CharsetInput
flash,%,examples/CharsetInput
RAM for global variables,%,examples/DigitalInputAdapter
flash,%,examples/DigitalInputAdapter
RAM for global variables,%,examples/DigitalInputWithRotaryAdapter
flash,%,examples/DigitalInputWithRotaryAdapter
RAM for global variables,%,examples/InputRotary
flash,%,examples/InputRotary
RAM for global variables,%,examples/IntFloatValues
flash,%,examples/IntFloatValues
RAM for global variables,%,examples/ItemBack
flash,%,examples/ItemBack
RAM for global variables,%,examples/KeyboardAdapter
flash,%,examples/KeyboardAdapter
RAM for global variables,%,examples/List
flash,%,examples/List
RAM for global variables,%,examples/MenuTimeout
flash,%,examples/MenuTimeout
RAM for global variables,%,examples/RTOS
flash,%,examples/RTOS
RAM for global variables,%,examples/SimpleInput
flash,%,examples/SimpleInput
RAM for global variables,%,examples/SimpleRotary
flash,%,examples/SimpleRotary
RAM for global variables,%,examples/SubMenu
flash,%,examples/SubMenu
RAM for global variables,% arduino:avr:uno,-44,-0.14,-2,-0.1,-52,-0.16,-4,-0.2,-300,-0.93,-4,-0.2,-40,-0.12,-4,-0.2,-336,-1.04,-8,-0.39,-328,-1.02,-8,-0.39,-128,-0.4,-4,-0.2,-72,-0.22,-6,-0.29,-300,-0.93,-4,-0.2,-118,-0.37,-4,-0.2,-44,-0.14,-2,-0.1,-72,-0.22,-6,-0.29,-146,-0.45,-4,-0.2,-188,-0.58,-8,-0.39,-64,-0.2,-4,-0.2 ```