diff --git a/grid_common/grid_lua.c b/grid_common/grid_lua.c index 211991d55..5e412a126 100644 --- a/grid_common/grid_lua.c +++ b/grid_common/grid_lua.c @@ -90,7 +90,7 @@ void grid_lua_clear_stdo(struct grid_lua_model* lua) { memset(lua->stdo, 0, lua- void grid_lua_clear_stde(struct grid_lua_model* lua) { memset(lua->stde, 0, lua->stde_len); } -int grid_lua_append_stdo(struct grid_lua_model* lua, char* str) { +int grid_lua_append_stdo(struct grid_lua_model* lua, const char* str) { int curr = strnlen(lua->stdo, lua->stdo_len); @@ -107,7 +107,7 @@ int grid_lua_append_stdo(struct grid_lua_model* lua, char* str) { return 0; } -int grid_lua_append_stde(struct grid_lua_model* lua, char* str) { +int grid_lua_append_stde(struct grid_lua_model* lua, const char* str) { int curr = strnlen(lua->stde, lua->stde_len); diff --git a/grid_common/grid_lua.h b/grid_common/grid_lua.h index 34dded7e4..e57e907f5 100644 --- a/grid_common/grid_lua.h +++ b/grid_common/grid_lua.h @@ -62,8 +62,8 @@ void grid_lua_clear_stdi(struct grid_lua_model* lua); void grid_lua_clear_stdo(struct grid_lua_model* lua); void grid_lua_clear_stde(struct grid_lua_model* lua); -int grid_lua_append_stdo(struct grid_lua_model* lua, char* str); -int grid_lua_append_stde(struct grid_lua_model* lua, char* str); +int grid_lua_append_stdo(struct grid_lua_model* lua, const char* str); +int grid_lua_append_stde(struct grid_lua_model* lua, const char* str); char* grid_lua_get_output_string(struct grid_lua_model* lua); char* grid_lua_get_error_string(struct grid_lua_model* lua); diff --git a/grid_common/grid_lua_api.c b/grid_common/grid_lua_api.c index 394aaeaa6..b4065b015 100644 --- a/grid_common/grid_lua_api.c +++ b/grid_common/grid_lua_api.c @@ -2196,7 +2196,12 @@ int l_grid_cat(lua_State* L) { return 0; } - int32_t min = lua_tointeger(L, -1); + int32_t min = 0; + + if (ele->type == GRID_PARAMETER_ELEMENT_BUTTON) { + min = lua_tointeger(L, -1); + } + lua_pop(L, 1); grid_cal_but_min_set(cal_but, i, min); @@ -2209,7 +2214,12 @@ int l_grid_cat(lua_State* L) { return 0; } - int32_t max = lua_tointeger(L, -1); + int32_t max = 0; + + if (ele->type == GRID_PARAMETER_ELEMENT_BUTTON) { + max = lua_tointeger(L, -1); + } + lua_pop(L, 1); grid_cal_but_max_set(cal_but, i, max); diff --git a/grid_common/grid_msg.c b/grid_common/grid_msg.c index 9b2ac55e3..43ed41b09 100644 --- a/grid_common/grid_msg.c +++ b/grid_common/grid_msg.c @@ -531,7 +531,7 @@ int grid_str_verify_frame(char* message, uint16_t length) { return 0; } -uint32_t grid_str_set_segment_char(char* dest, uint8_t head_hexes, uint32_t size, char* buffer) { +uint32_t grid_str_set_segment_char(char* dest, uint8_t head_hexes, uint32_t size, const char* buffer) { switch (head_hexes) { case 2: diff --git a/grid_common/grid_msg.h b/grid_common/grid_msg.h index 8e5bc860c..de688570e 100644 --- a/grid_common/grid_msg.h +++ b/grid_common/grid_msg.h @@ -131,7 +131,7 @@ void grid_str_write_hex_string_value(char* start_location, uint8_t size, uint32_ int grid_str_verify_frame(char* message, uint16_t length); -uint32_t grid_str_set_segment_char(char* dest, uint8_t head_bytes, uint32_t size, char* buffer); +uint32_t grid_str_set_segment_char(char* dest, uint8_t head_bytes, uint32_t size, const char* buffer); uint32_t grid_str_get_segment_char(char* src, uint8_t head_hexes, uint32_t max_size, char* buffer); #endif /* GRID_MSG_H */ diff --git a/grid_esp/components/grid_esp32_module_tek1/grid_esp32_module_tek1.c b/grid_esp/components/grid_esp32_module_tek1/grid_esp32_module_tek1.c index b76896ee3..dcc6cecc8 100644 --- a/grid_esp/components/grid_esp32_module_tek1/grid_esp32_module_tek1.c +++ b/grid_esp/components/grid_esp32_module_tek1/grid_esp32_module_tek1.c @@ -228,11 +228,9 @@ void grid_esp32_module_tek1_init(struct grid_sys_model* sys, struct grid_ui_mode struct grid_esp32_lcd_model* lcds) { // Allocate transfer buffer - uint32_t width = LCD_HRES; uint32_t height = LCD_VRES; uint32_t lcd_tx_lines = 16; uint32_t lcd_tx_bytes = height * lcd_tx_lines * COLMOD_RGB888_BYTES; - // uint8_t* xferbuf = malloc(lcd_tx_bytes); // Initialize LCD grid_esp32_lcd_spi_bus_init(lcd_tx_bytes); diff --git a/grid_esp/components/grid_esp32_usb/grid_esp32_usb.c b/grid_esp/components/grid_esp32_usb/grid_esp32_usb.c index 0fd6a87f7..99599922b 100644 --- a/grid_esp/components/grid_esp32_usb/grid_esp32_usb.c +++ b/grid_esp/components/grid_esp32_usb/grid_esp32_usb.c @@ -41,7 +41,6 @@ void tud_midi_rx_cb(uint8_t itf) { // regardless of these being used or not. Therefore incoming traffic should be // read (possibly just discarded) to avoid the sender blocking in IO uint8_t packet[4]; - bool read = false; while (tud_midi_available()) {