Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Fixes to make snes_macropad play nicer with qmk configurator #22432

Merged
merged 3 commits into from
Nov 12, 2023
Merged
Changes from 1 commit
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
Next Next commit
[Keyboard] Change default implementation for get_layer_name_user
Will now show the layer number instead of "Unknown", since this is
what will be shown if QMK Configurator is used to compile the
firmware.
  • Loading branch information
JBarberU committed Nov 9, 2023
commit 9ec70b832ad273890e28e36dce43da241b504a98
5 changes: 4 additions & 1 deletion keyboards/snes_macropad/snes_macropad.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ char key_name = ' ';
uint16_t last_keycode;
uint8_t last_row;
uint8_t last_col;
char layer_str[3] = ""; // 2 digits + null terminator
JBarberU marked this conversation as resolved.
Show resolved Hide resolved
_Static_assert(MAX_LAYER < 100, "layer_str is too small");
JBarberU marked this conversation as resolved.
Show resolved Hide resolved

static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};

Expand Down Expand Up @@ -58,7 +60,8 @@ static void oled_render_keylog(void) {
}

__attribute__((weak)) const char * get_layer_name_user(int layer) {
return "Unknown";
snprintf(layer_str, sizeof(layer_str), "%d", layer);
return layer_str;
JBarberU marked this conversation as resolved.
Show resolved Hide resolved
}

static void oled_render_layer(void) {
Expand Down