Skip to content
2 changes: 1 addition & 1 deletion grid_common/grid_littlefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,4 @@ int grid_littlefs_closedir(lfs_t* lfs, lfs_dir_t* dirp) {

struct lfs_info READDIR = {0};

const char* grid_littlefs_readdir(lfs_t* lfs, lfs_dir_t* dirp) { return lfs_dir_read(lfs, dirp, &READDIR) > 0 ? READDIR.name : NULL; }
char* grid_littlefs_readdir(lfs_t* lfs, lfs_dir_t* dirp) { return lfs_dir_read(lfs, dirp, &READDIR) > 0 ? READDIR.name : NULL; }
2 changes: 1 addition & 1 deletion grid_common/grid_littlefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ ssize_t grid_littlefs_fseek(lfs_t* lfs, lfs_file_t* stream, lfs_soff_t soff, int
int grid_littlefs_fflush(lfs_t* lfs, lfs_file_t* stream);
lfs_dir_t* grid_littlefs_opendir(lfs_t* lfs, const char* name);
int grid_littlefs_closedir(lfs_t* lfs, lfs_dir_t* dirp);
const char* grid_littlefs_readdir(lfs_t* lfs, lfs_dir_t* dirp);
char* grid_littlefs_readdir(lfs_t* lfs, lfs_dir_t* dirp);

#endif /* GRID_LITTLEFS_H */
4 changes: 2 additions & 2 deletions grid_common/grid_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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 @@ -126,7 +126,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 @@ -63,8 +63,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
3 changes: 1 addition & 2 deletions grid_common/grid_lua_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ int l_grid_cat(lua_State* L) {
return 0;
}

char* name = lua_tostring(L, 2);
const char* name = lua_tostring(L, 2);

if (strlen(name) > GRID_ELEMENT_NAME_MAX) {
return 0;
Expand Down Expand Up @@ -937,7 +937,6 @@ int l_grid_cat(lua_State* L) {

uint16_t offset = GRID_CLASS_MIDISYSEX_PAYLOAD_offset + i * 2 - 2;
uint8_t length = GRID_CLASS_MIDISYSEX_PAYLOAD_length;
uint8_t* dest = (uint8_t*)&frame[GRID_CLASS_MIDISYSEX_PAYLOAD_offset + i * 2 - 2];
grid_frame_set_parameter((uint8_t*)frame, offset, length, lua_tointeger(L, i));
}

Expand Down
8 changes: 3 additions & 5 deletions grid_common/grid_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void print_u32(uint8_t x) {
grid_platform_printf("\n");
}

uint8_t grid_frame_calculate_checksum_string(uint8_t* frame, size_t length) {
uint8_t grid_frame_calculate_checksum_string(const uint8_t* frame, size_t length) {

/*
uint8_t u8 = 0;
Expand Down Expand Up @@ -131,7 +131,7 @@ uint8_t grid_frame_calculate_checksum_string(uint8_t* frame, size_t length) {
return u8;
}

uint8_t grid_frame_calculate_checksum_packet(uint8_t* frame, size_t length) {
uint8_t grid_frame_calculate_checksum_packet(const uint8_t* frame, size_t length) {

assert(length > 3);

Expand Down Expand Up @@ -303,7 +303,7 @@ int grid_msg_nprintf(struct grid_msg* msg, const char* fmt, ...) {
return n >= remain ? -1 : n;
}

int grid_msg_add_segment_char(struct grid_msg* msg, uint8_t head_hexes, uint32_t size, char* buffer) {
int grid_msg_add_segment_char(struct grid_msg* msg, uint8_t head_hexes, uint32_t size, const char* buffer) {

assert(msg->length <= GRID_MSG_BYTES);

Expand Down Expand Up @@ -358,8 +358,6 @@ int grid_msg_add_debugtext(struct grid_msg* msg, const char* text) {

uint32_t length_prev = msg->length;

bool success = true;

if (grid_msg_add_frame(msg, GRID_CLASS_DEBUGTEXT_frame_start) < 0) {
goto grid_msg_add_debugtext_revert;
}
Expand Down
6 changes: 3 additions & 3 deletions grid_common/grid_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ uint8_t grid_msg_get_heartbeat_type(struct grid_msg_model* msg);
void grid_msg_set_editor_heartbeat_lastrealtime(struct grid_msg_model* msg, uint64_t timestamp);
uint64_t grid_msg_get_editor_heartbeat_lastrealtime(struct grid_msg_model* msg);

uint8_t grid_frame_calculate_checksum_string(uint8_t* frame, size_t length);
uint8_t grid_frame_calculate_checksum_packet(uint8_t* frame, size_t length);
uint8_t grid_frame_calculate_checksum_string(const uint8_t* frame, size_t length);
uint8_t grid_frame_calculate_checksum_packet(const uint8_t* frame, size_t length);

uint32_t grid_frame_get_parameter(const uint8_t* frame, uint16_t offset, uint8_t length);
void grid_frame_set_parameter(uint8_t* frame, uint16_t offset, uint8_t length, uint32_t value);
Expand All @@ -72,7 +72,7 @@ int grid_msg_close(struct grid_msg* msg);
void grid_msg_init_brc(struct grid_msg_model* model, struct grid_msg* msg, uint8_t dx, uint8_t dy);
int grid_msg_close_brc(struct grid_msg_model* model, struct grid_msg* msg);
int grid_msg_nprintf(struct grid_msg* msg, const char* fmt, ...);
int grid_msg_add_segment_char(struct grid_msg* msg, uint8_t head_hexes, uint32_t size, char* buffer);
int grid_msg_add_segment_char(struct grid_msg* msg, uint8_t head_hexes, uint32_t size, const char* buffer);
int grid_msg_add_hex_bytes(struct grid_msg* msg, uint8_t* data, uint16_t length);
int grid_msg_add_debugtext(struct grid_msg* msg, const char* text);
int grid_msg_move(struct grid_msg* dest, struct grid_msg* src);
Expand Down
7 changes: 6 additions & 1 deletion grid_common/grid_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void grid_ui_event_render_action(struct grid_ui_event* eve, struct grid_msg* msg
}

char* stdo = grid_lua_get_output_string(&grid_lua_state);
int ret = grid_msg_nprintf(msg, "%s", stdo);
grid_msg_nprintf(msg, "%s", stdo);
grid_lua_clear_stdo(&grid_lua_state);

grid_lua_clear_stde(&grid_lua_state);
Expand Down Expand Up @@ -926,6 +926,9 @@ void grid_ui_bulk_flush(struct grid_ui_model* ui) {
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"

PT_THREAD(grid_ui_bulk_page_load(proto_pt_t* pt, struct grid_ui_model* ui)) {

// Reset all state parameters of all leds
Expand Down Expand Up @@ -1292,3 +1295,5 @@ PT_THREAD(grid_ui_bulk_nvm_erase(proto_pt_t* pt, struct grid_ui_model* ui)) {

PT_END(pt);
}

#pragma GCC diagnostic pop
2 changes: 0 additions & 2 deletions grid_esp/components/grid_esp32_led/grid_esp32_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "grid_esp32_led.h"

static const char* TAG = "LED";

static DRAM_ATTR rmt_channel_handle_t CHANNEL = NULL;
static DRAM_ATTR rmt_encoder_handle_t ENCODER = NULL;

Expand Down
2 changes: 1 addition & 1 deletion grid_esp/components/grid_esp32_port/grid_esp32_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void handle_connection_effect() {

bool grid_esp32_broadcast_between(enum grid_port_type t1, enum grid_port_type t2) { return !(t1 == GRID_PORT_USART && t2 == GRID_PORT_USART); }

extern bool rp2040_active = false;
bool rp2040_active = false;

void grid_esp32_port_task(void* arg) {

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 @@ -42,7 +42,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
2 changes: 2 additions & 0 deletions grid_esp/components/grid_esp32_usb/grid_esp32_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
extern "C" {
#endif

/*
#undef CFG_TUD_CDC
#undef CFG_TUD_HID
#undef CFG_TUD_MIDI
Expand All @@ -22,6 +23,7 @@ extern "C" {
#define CFG_TUD_MIDI 1
#define CFG_TUD_MSC 0
#define CFG_TUD_VENDOR 0
*/

/* HID Mouse Class Pointer Move Type */
enum mouse_move_type { X_AXIS_MV = 0x01, Y_AXIS_MV = 0x02, SCROLL_MV = 0x03 };
Expand Down
2 changes: 1 addition & 1 deletion grid_esp/main/grid_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "esp_random.h"

#include "tinyusb.h"
#include "tusb_cdc_acm.h"
#include "tinyusb_cdc_acm.h"

#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
Expand Down
4 changes: 1 addition & 3 deletions grid_esp/main/grid_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
static const char* TAG = "main";

#include "tinyusb.h"
#include "tusb_cdc_acm.h"
#include "tinyusb_cdc_acm.h"

static bool periodic_rtc_ms_cb() {

Expand Down Expand Up @@ -504,8 +504,6 @@ void app_main(void) {

log_checkpoint("GUI INIT");

uint32_t hwcfg = grid_sys_get_hwcfg(&grid_sys_state);

// Initialize font
if (grid_hwcfg_module_is_vsnx(&grid_sys_state)) {
grid_font_init(&grid_font_state);
Expand Down
3 changes: 3 additions & 0 deletions vmp/vmp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "vmp.h"

void* (*VMP_ALLOC)(size_t) = malloc;
void (*VMP_DEALLOC)(void*) = free;

uint32_t htonl(uint32_t hostlong) { return hostlong; }
uint16_t htons(uint16_t hostshort) { return hostshort; }
uint32_t ntohl(uint32_t netlong) { return netlong; }
Expand Down
4 changes: 2 additions & 2 deletions vmp/vmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <stdlib.h>
#include <string.h>

static void* (*VMP_ALLOC)(size_t) = malloc;
static void (*VMP_DEALLOC)(void*) = free;
extern void* (*VMP_ALLOC)(size_t);
extern void (*VMP_DEALLOC)(void*);

#define vmp_alloc(a) VMP_ALLOC(a)
#define vmp_dealloc(a) VMP_DEALLOC(a)
Expand Down