diff --git a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c index 9b53d0e91be..de0c3b22d1d 100644 --- a/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x5/keymaps/stock/keymap.c @@ -234,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_INC: if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) change_pointer_dpi(&global_user_config, true); #endif /* ifdef POINTING_DEVICE */ debug_config_to_console(&global_user_config); @@ -252,7 +252,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { break; case MSE_TOGG: if (record->event.pressed) { -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) +#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) bool current_state = get_auto_mouse_enable(); set_auto_mouse_enable(!current_state); #endif /* ifdef POINTING_DEVICE */ @@ -267,52 +267,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT) -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(false); -} -#endif /* ifdef POINTING_DEVICE */ diff --git a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c index 31f5fd6ee09..7d44af0d90d 100644 --- a/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/3x6/keymaps/stock/keymap.c @@ -255,37 +255,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - const char* layer_names[] = { - [_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ", - }; - - oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/3x6/rev2/keyboard.json b/keyboards/gggw/crosses/3x6/rev2/keyboard.json index 9f6cd339b82..deb6c844e7b 100644 --- a/keyboards/gggw/crosses/3x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/3x6/rev2/keyboard.json @@ -1,4 +1,5 @@ { + "keyboard_name": "Crosses 3x6 rev2", "matrix_pins": { "cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP27", "GP28", "GP29", "GP7"] diff --git a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c index bffd93eb7b5..eb60a5e9cb5 100644 --- a/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c +++ b/keyboards/gggw/crosses/4x6/keymaps/stock/keymap.c @@ -173,51 +173,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { return true; } - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) { - return OLED_ROTATION_180; - } - - return rotation; -} - -static void render_logo(void) { - static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; - - oled_write_P(qmk_logo, false); -} - -bool oled_task_user(void) { - render_logo(); - - // clang-format off - const char* layer_names[] = { - [_BASE] = "BASE CPI: ", - [_NUM] = "PROG CPI: ", - [_NAV] = "NAVI CPI: ", - [_MEDIA] = "MEDIA CPI: ", - [_FUNC] = "FUNC CPI: ", - [_MOUS] = "MOUSE CPI: ", - [_CUST] = "CUST CPI: ", - }; - // clang-format on - - char cpi_str[6]; - uint16_t current_dpi = get_pointer_dpi(&global_user_config); - - snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); - - oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); - oled_write(cpi_str, false); - - return false; -} -#endif /* ifdef OLED_ENABLE */ - -void pointing_device_init_user(void) { - set_auto_mouse_layer(_MOUS); - set_auto_mouse_enable(true); -} diff --git a/keyboards/gggw/crosses/4x6/rev2/keyboard.json b/keyboards/gggw/crosses/4x6/rev2/keyboard.json index 6aa88f63bbe..e2997285fb3 100644 --- a/keyboards/gggw/crosses/4x6/rev2/keyboard.json +++ b/keyboards/gggw/crosses/4x6/rev2/keyboard.json @@ -1,5 +1,5 @@ { - "keyboard_name": "Crosses 54 Rev2", + "keyboard_name": "Crosses 4x6 rev2", "matrix_pins": { "cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"], "rows": ["GP5", "GP27", "GP28", "GP29", "GP7"] diff --git a/keyboards/gggw/crosses/crosses.c b/keyboards/gggw/crosses/crosses.c index 3d3622e7243..d37349b8af4 100644 --- a/keyboards/gggw/crosses/crosses.c +++ b/keyboards/gggw/crosses/crosses.c @@ -195,20 +195,24 @@ void secondary_sync_handler(uint8_t in_buflen, const void* in_data, uint8_t out_ } void housekeeping_task_kb(void) { - if (!is_keyboard_master()) { return; } + if (!is_keyboard_master()) { + return; + } static global_user_config_t last_config = {0}; - static uint32_t last_sync = 0; - bool should_sync = false; + static uint32_t last_sync = 0; + bool should_sync = false; if (memcmp(&global_user_config, &last_config, sizeof(global_user_config))) { should_sync = true; memcpy(&last_config, &global_user_config, sizeof(global_user_config)); } - should_sync = (timer_elapsed32(last_sync) > 500); + should_sync = (timer_elapsed32(last_sync) > 500); - if (!should_sync) { return; } + if (!should_sync) { + return; + } if (transaction_rpc_send(CROSSES_SECONDARY_SYNC_ID, sizeof(global_user_config), &global_user_config)) { last_sync = timer_read32(); @@ -227,3 +231,52 @@ void keyboard_post_init_kb(void) { keyboard_post_init_user(); } + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; + } + + return rotation; +} + +# if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT) +void pointing_device_init_kb(void) { + set_auto_mouse_layer(_MOUS); + set_auto_mouse_enable(false); +} +# endif /* ifdef POINTING_DEVICE */ + +static void render_logo(void) { + static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00}; + + oled_write_P(qmk_logo, false); +} + +bool oled_task_kb(void) { + render_logo(); + + // clang-format off + const char* layer_names[] = { + [0] = "BASE CPI: ", + [1] = "PROG CPI: ", + [2] = "NAVI CPI: ", + [3] = "MEDIA CPI: ", + [4] = "FUNC CPI: ", + [5] = "MOUSE CPI: ", + }; + // clang-format on + + char cpi_str[6]; + uint16_t current_dpi = get_pointer_dpi(&global_user_config); + + snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi); + + oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false); + oled_write(cpi_str, false); + + return false; +} +#endif /* ifdef OLED_ENABLE */