Compare commits

..

2 Commits

Author SHA1 Message Date
fc2372f754 Fix possible error in menu implementation 2020-06-04 21:47:31 +02:00
92c0c5cd8c shrink shellmatta history buffer 2020-06-04 21:46:45 +02:00
3 changed files with 7 additions and 6 deletions

View File

@ -24,7 +24,6 @@
#include <stdint.h> #include <stdint.h>
#include <reflow-controller/button.h> #include <reflow-controller/button.h>
#include <stdbool.h> #include <stdbool.h>
#include <reflow-controller/ui/lcd.h>
struct lcd_menu; struct lcd_menu;

View File

@ -44,7 +44,7 @@
extern struct stm_uart shell_uart; extern struct stm_uart shell_uart;
static shellmatta_instance_t shell; static shellmatta_instance_t shell;
static char shell_buffer[512]; static char shell_buffer[512];
static char history_buffer[1024]; static char history_buffer[600];
static shellmatta_retCode_t shell_cmd_ver(const shellmatta_handle_t handle, static shellmatta_retCode_t shell_cmd_ver(const shellmatta_handle_t handle,
const char *arguments, const char *arguments,

View File

@ -31,13 +31,15 @@ void menu_handle(struct lcd_menu *menu, uint16_t rotary_encoder_delta, enum butt
menu->inputs.push_button = push_button; menu->inputs.push_button = push_button;
menu->inputs.rotary_encoder_delta = rotary_encoder_delta; menu->inputs.rotary_encoder_delta = rotary_encoder_delta;
if (menu->active_entry == NULL)
menu->active_entry = menu->root_entry;
tmp = menu->active_entry; tmp = menu->active_entry;
if (menu->active_entry_type == MENU_ENTRY_FIRST_ENTER) { if (menu->active_entry_type == MENU_ENTRY_FIRST_ENTER) {
if (menu->active_entry)
menu->active_entry(menu, menu->active_entry_type, menu->init_parent); menu->active_entry(menu, menu->active_entry_type, menu->init_parent);
} else { } else {
if (menu->active_entry)
menu->active_entry(menu, menu->active_entry_type, NULL); menu->active_entry(menu, menu->active_entry_type, NULL);
} }