Skip to content

Commit

Permalink
Some warning cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
whowechina committed Jun 18, 2024
1 parent 8c84a99 commit 31f981f
Show file tree
Hide file tree
Showing 8 changed files with 406 additions and 414 deletions.
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
PCB/Keyboard/iidx_teeny-backups/
Production/PCB/Turntable
Production/PCB/teeny_iidx
Production/PCB/*/
*-backups
.editorconfig
.vscode
firmware/mai2/mai2hook
PCB/IO/mai_io-backups

Binary file modified Production/firmware/mai_pico.uf2
Binary file not shown.
14 changes: 5 additions & 9 deletions firmware/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set(BTSTACK_ROOT ${PICO_SDK_PATH}/lib/btstack)
set(LWIP_ROOT ${PICO_SDK_PATH}/lib/lwip)
pico_sdk_init()

include_directories(${CMAKE_CURRENT_LIST_DIR})
add_compile_options(-Wall -Werror -Wfatal-errors -O3)

function(make_firmware board board_def)
pico_sdk_init()
add_executable(${board}
main.c touch.c button.c rgb.c save.c config.c cli.c commands.c io.c hid.c
mpr121.c usb_descriptors.c)
Expand All @@ -11,12 +12,7 @@ function(make_firmware board board_def)
pico_enable_stdio_uart(${board} 0)

pico_generate_pio_header(${board} ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio)

target_compile_options(${board} PRIVATE -Wfatal-errors -O3)
target_include_directories(${board} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(${board} PRIVATE
${BTSTACK_ROOT}/src
${LWIP_ROOT}/src/include)


target_link_libraries(${board} PRIVATE
aic
Expand Down
10 changes: 5 additions & 5 deletions firmware/src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ static void disp_rgb()
printf("[RGB]\n");
printf(" Number per button: %d, number per aux: %d\n",
mai_cfg->rgb.per_button, mai_cfg->rgb.per_aux);
printf(" Key on: %06x, off: %06x\n Level: %d\n",
printf(" Key on: %06lx, off: %06lx\n Level: %d\n",
mai_cfg->color.key_on, mai_cfg->color.key_off, mai_cfg->color.level);
}

static void print_sense_zone(const char *title, const uint8_t *zones, int num)
static void print_sense_zone(const char *title, const int8_t *zones, int num)
{
printf(" %s |", title);
for (int i = 0; i < num; i++) {
Expand Down Expand Up @@ -276,7 +276,7 @@ static void handle_filter(int argc, char *argv[])
disp_sense();
}

static uint8_t *extract_key(const char *param)
static int8_t *extract_key(const char *param)
{
if (strlen(param) != 2) {
return NULL;
Expand Down Expand Up @@ -319,7 +319,7 @@ static void handle_sense(int argc, char *argv[])
" >sense +\n"
" >sense -\n"
" >sense A3 +\n"
" >sense C1 -\n";
" >sense C1 -\n"
" >sense * 0\n";
if ((argc < 1) || (argc > 2)) {
printf(usage);
Expand All @@ -340,7 +340,7 @@ static void handle_sense(int argc, char *argv[])
sense_do_op(&mai_cfg->sense.zones[i], op[0]);
}
} else {
uint8_t *key = extract_key(argv[0]);
int8_t *key = extract_key(argv[0]);
if (!key) {
printf(usage);
return;
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void report_usb_hid()
uint16_t buttons = button_read();
hid_joy.buttons[0] = native_to_io4(buttons);
hid_joy.buttons[1] = native_to_io4(0);
if (last_buttons ^ buttons & (1 << 11)) {
if ((last_buttons ^ buttons) & (1 << 11)) {
if (buttons & (1 << 11)) {
// just pressed coin button
hid_joy.chutes[0] += 0x100;
Expand Down
1 change: 0 additions & 1 deletion firmware/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

static void run_lights()
{
uint64_t now = time_us_64();
if (io_is_active() || aime_is_active()) {
return;
}
Expand Down
Loading

0 comments on commit 31f981f

Please sign in to comment.