Jomelo / LCDMenuLib2

Create a tree menu. Use it with different lcd types / console output / ssh console.
MIT License
249 stars 46 forks source link

REG_control not initialized #73

Closed larmart closed 1 year ago

larmart commented 3 years ago
_class LCDMenuLib2_menu
{
      uint8_t REG_control;     // control register
      [...]
 }

 LCDMenuLib2_menu::LCDMenuLib2_menu(uint8_t p_id, uint8_t p_param, uint8_t p_configuration, LCDML_FuncPtr_pu8 
 p_callback_function, LCDML_FuncPtr_rb p_callback_condition)
{
switch(p_configuration)
{
    case _LCDML_TYPE_default:  bitSet(REG_control, _LCDML_REG_MENU_CONTROL_type_default);   break;
    case _LCDML_TYPE_dynParam: bitSet(REG_control, _LCDML_REG_MENU_CONTROL_type_dynParam);  break;
    default:
        break;
}_ 

The following variable needs to be intialized: REG_control = 0; Current behaviour: It is sometimes not possible to step into a child menu element, because the bit "_LCDML_REG_MENU_CONTROL_type_dynParam" is set randomly.

Jomelo commented 3 years ago

Hey, i fix this bug with the next version. Best Regards,