From 49a714ff2a31e66abee8dd8958a27fa16cf7d2e1 Mon Sep 17 00:00:00 2001 From: benblaise Date: Fri, 5 Sep 2025 16:38:46 +0200 Subject: [PATCH 1/5] BENB fix warnings in grid_lua.h and grid_lua.c --- grid_common/grid_lua.c | 4 ++-- grid_common/grid_lua.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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); From 9ab02512833f7c73afc335a3c5812e7b33ed3942 Mon Sep 17 00:00:00 2001 From: benblaise Date: Fri, 5 Sep 2025 16:40:30 +0200 Subject: [PATCH 2/5] BENB fix warnings in grid_msg.h and grid_msg.c --- grid_common/grid_msg.c | 2 +- grid_common/grid_msg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 */ From d7600ebe2f0dc2ef2886dcbde1f6b568ab0e1657 Mon Sep 17 00:00:00 2001 From: benblaise Date: Fri, 5 Sep 2025 16:41:26 +0200 Subject: [PATCH 3/5] BENB fix warnings in grid_esp32_module_tek1.c --- .../components/grid_esp32_module_tek1/grid_esp32_module_tek1.c | 2 -- 1 file changed, 2 deletions(-) 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); From 2040f40c36aaa513959a5a1736de95e0faea7a82 Mon Sep 17 00:00:00 2001 From: benblaise Date: Fri, 5 Sep 2025 16:41:54 +0200 Subject: [PATCH 4/5] BEN fix warnings in grid_esp32_usb.c --- grid_esp/components/grid_esp32_usb/grid_esp32_usb.c | 1 - 1 file changed, 1 deletion(-) 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()) { From 46b662a1ba2518fca16b53b0820c9905637252df Mon Sep 17 00:00:00 2001 From: benblaise Date: Fri, 5 Sep 2025 16:44:55 +0200 Subject: [PATCH 5/5] BENB fix warnings in grid_lua_api.c --- grid_common/grid_lua_api.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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);