Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions grid_common/grid_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions grid_common/grid_lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 12 additions & 2 deletions grid_common/grid_lua_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion grid_common/grid_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion grid_common/grid_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion grid_esp/components/grid_esp32_usb/grid_esp32_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {

Expand Down