From c8c0b2d130f6969a185d9c5bab0cb5c29b9ba2fe Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sat, 5 Feb 2022 20:45:29 +0000 Subject: [PATCH 01/25] sync oled code over the keymaps --- keyboards/mlego/m65/keymaps/default/keymap.c | 79 ++++++++++++++ keyboards/mlego/m65/keymaps/dk/keymap.c | 79 ++++++++++++++ keyboards/mlego/m65/keymaps/via/keymap.c | 106 +++++++++++-------- 3 files changed, 222 insertions(+), 42 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index 96a1ced900c5..141cf35bdce1 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -24,6 +24,17 @@ enum layer_names { _ADJ }; +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM m65_logo[] = { + 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, + 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, + 0}; +#endif + #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -167,3 +178,71 @@ bool encoder_update_user(uint8_t index, bool clockwise) { return true; } #endif + +#ifdef OLED_ENABLE + +static void render_logo(void) { + oled_write_P(m65_logo, false); +} + +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QW: + oled_write_P(PSTR("Default\n"), false); + break; + case _LWR: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RSE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); +#ifdef WPM_ENABLE + oled_write_P(PSTR("\nwpm: "), false); + uint8_t wpm = get_current_wpm(); + oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); +#endif +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + +# define SHOW_LOGO 5000 +bool oled_task_user(void) { + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } + return false; +} + +#endif diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index 5461a354ba19..ffdb77f2ebb5 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -25,6 +25,17 @@ enum layer_names { _ADJ }; +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM m65_logo[] = { + 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, + 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, + 0}; +#endif + #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -168,3 +179,71 @@ bool encoder_update_user(uint8_t index, bool clockwise) { return true; } #endif + +#ifdef OLED_ENABLE + +static void render_logo(void) { + oled_write_P(m65_logo, false); +} + +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QW: + oled_write_P(PSTR("Default\n"), false); + break; + case _LWR: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RSE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); +#ifdef WPM_ENABLE + oled_write_P(PSTR("\nwpm: "), false); + uint8_t wpm = get_current_wpm(); + oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); +#endif +} + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + +# define SHOW_LOGO 5000 +bool oled_task_user(void) { + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } + return false; +} + +#endif diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 1422eed34ef8..f058c50fcb95 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -24,6 +24,17 @@ enum layer_names { _ADJ }; +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM m65_logo[] = { + 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, + 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, + 0}; +#endif + #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -170,55 +181,66 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE static void render_logo(void) { - static const char PROGMEM m65_logo[] = { -// 'slon', 128x32px -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0xc0, 0xa0, 0xa0, -0xa0, 0xd0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0c, 0xc3, 0x3c, 0x0f, 0x05, 0x14, 0x14, -0x04, 0xfc, 0x9f, 0x88, 0x80, 0x81, 0xe7, 0xfc, 0x03, 0x03, 0x07, 0x05, 0x06, 0x06, 0x08, 0x0c, -0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x04, 0x10, 0x18, 0x30, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xe0, 0xde, 0xc1, 0xf0, 0x89, 0x0b, 0x18, 0x08, 0x04, 0x04, -0x01, 0x1a, 0x0f, 0x00, 0x00, 0x80, 0xc0, 0x20, 0x20, 0x20, 0x60, 0x40, 0x40, 0x42, 0x40, 0x40, -0x40, 0x40, 0x40, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x13, 0x7c, 0xe0, 0xc0, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x05, -0x05, 0x05, 0x07, 0x05, 0x07, 0x07, 0x07, 0x07, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, -0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, -0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x07, -0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, -0x04, 0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00 - }; - - oled_write_raw_P(m65_logo, sizeof(m65_logo)); - + oled_write_P(m65_logo, false); } +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QW: + oled_write_P(PSTR("Default\n"), false); + break; + case _LWR: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RSE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); +#ifdef WPM_ENABLE + oled_write_P(PSTR("\nwpm: "), false); + uint8_t wpm = get_current_wpm(); + oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); +#endif +} oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return rotation; + return OLED_ROTATION_180; } +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + +# define SHOW_LOGO 5000 bool oled_task_user(void) { - //user_oled_magic(); - render_logo(); + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } return false; } From 768e416680c4a1fe89e6db3571538ae7a9eaba24 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sat, 5 Feb 2022 20:45:56 +0000 Subject: [PATCH 02/25] put different product ids --- keyboards/mlego/m65/rev1/config.h | 2 +- keyboards/mlego/m65/rev2/config.h | 2 +- keyboards/mlego/m65/rev3/config.h | 2 +- keyboards/mlego/m65/rev4/config.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/mlego/m65/rev1/config.h b/keyboards/mlego/m65/rev1/config.h index e0a703c978c6..0e40ae2e3da6 100644 --- a/keyboards/mlego/m65/rev1/config.h +++ b/keyboards/mlego/m65/rev1/config.h @@ -18,7 +18,7 @@ along with this program. If not, see . #pragma once #define DEVICE_VER 0x0001 -#define PRODUCT_ID 0x6060 +#define PRODUCT_ID 0x6061 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 diff --git a/keyboards/mlego/m65/rev2/config.h b/keyboards/mlego/m65/rev2/config.h index a548b018270b..40ac047d7d9f 100644 --- a/keyboards/mlego/m65/rev2/config.h +++ b/keyboards/mlego/m65/rev2/config.h @@ -18,7 +18,7 @@ along with this program. If not, see . #pragma once #define DEVICE_VER 0x0002 -#define PRODUCT_ID 0x6060 +#define PRODUCT_ID 0x6062 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 diff --git a/keyboards/mlego/m65/rev3/config.h b/keyboards/mlego/m65/rev3/config.h index 97992ee84434..11bf1df0e160 100644 --- a/keyboards/mlego/m65/rev3/config.h +++ b/keyboards/mlego/m65/rev3/config.h @@ -18,7 +18,7 @@ along with this program. If not, see . #pragma once #define DEVICE_VER 0x0003 -#define PRODUCT_ID 0x6060 +#define PRODUCT_ID 0x6063 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h index ee47061a91fe..48950c084eeb 100644 --- a/keyboards/mlego/m65/rev4/config.h +++ b/keyboards/mlego/m65/rev4/config.h @@ -18,7 +18,7 @@ along with this program. If not, see . #pragma once #define DEVICE_VER 0x0004 -#define PRODUCT_ID 0x6060 +#define PRODUCT_ID 0x6064 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 From e0e96976b18d3568a4016b51ac49d200e789ce3b Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sat, 5 Feb 2022 20:47:14 +0000 Subject: [PATCH 03/25] put different product ids for the rest --- keyboards/mlego/m48/rev1/config.h | 2 +- keyboards/mlego/m60/rev1/config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/mlego/m48/rev1/config.h b/keyboards/mlego/m48/rev1/config.h index 85da34f17a7a..217f35c33118 100644 --- a/keyboards/mlego/m48/rev1/config.h +++ b/keyboards/mlego/m48/rev1/config.h @@ -19,7 +19,7 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x0001 +#define DEVICE_VER 0x6261 #define MATRIX_ROW_PINS \ { A6, A7, B0, B10 } diff --git a/keyboards/mlego/m60/rev1/config.h b/keyboards/mlego/m60/rev1/config.h index c05f30813a9b..a090d643c250 100644 --- a/keyboards/mlego/m60/rev1/config.h +++ b/keyboards/mlego/m60/rev1/config.h @@ -19,7 +19,7 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x0001 +#define DEVICE_VER 0x6161 #define MATRIX_ROW_PINS \ { A6, A7, B0, B1, B10 } From 2d104aea0a11003583c9e251ff5eed5131c8970a Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sat, 5 Feb 2022 21:16:13 +0000 Subject: [PATCH 04/25] put different product ids for the rest --- keyboards/mlego/m48/rev1/config.h | 4 ++-- keyboards/mlego/m60/rev1/config.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/mlego/m48/rev1/config.h b/keyboards/mlego/m48/rev1/config.h index 217f35c33118..4c43bcc93ac2 100644 --- a/keyboards/mlego/m48/rev1/config.h +++ b/keyboards/mlego/m48/rev1/config.h @@ -18,8 +18,8 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x6261 +#define PRODUCT_ID 0x6261 +#define DEVICE_VER 0x0003 #define MATRIX_ROW_PINS \ { A6, A7, B0, B10 } diff --git a/keyboards/mlego/m60/rev1/config.h b/keyboards/mlego/m60/rev1/config.h index a090d643c250..226f413c2420 100644 --- a/keyboards/mlego/m60/rev1/config.h +++ b/keyboards/mlego/m60/rev1/config.h @@ -18,8 +18,8 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x6161 +#define PRODUCT_ID 0x6161 +#define DEVICE_VER 0x0003 #define MATRIX_ROW_PINS \ { A6, A7, B0, B1, B10 } From b822058724b003c4190cc2cdabc8e415f143de51 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 07:45:35 +0000 Subject: [PATCH 05/25] try to reduce code duplication --- keyboards/mlego/m65/keymaps/default/keymap.c | 82 ++------------------ keyboards/mlego/m65/keymaps/dk/keymap.c | 82 ++------------------ keyboards/mlego/m65/keymaps/uk/keymap.c | 82 ++------------------ keyboards/mlego/m65/keymaps/via/keymap.c | 82 ++------------------ keyboards/mlego/m65/m65.c | 78 +++++++++++++++++++ keyboards/mlego/m65/m65.h | 16 ++++ 6 files changed, 121 insertions(+), 301 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index 141cf35bdce1..76131cba33d0 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -17,24 +17,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -enum layer_names { - _QW = 0, - _LWR, - _RSE, - _ADJ -}; - -#ifdef OLED_ENABLE -static uint32_t oled_logo_timer = 0; -static bool clear_logo = true; -static const char PROGMEM m65_logo[] = { - 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 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, - 0}; -#endif - #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -141,6 +123,9 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { void keyboard_post_init_user(void) { // Enable the LED layers rgblight_layers = my_rgb_layers; +#ifdef OLED_ENABLE + init_timer(); +#endif } #endif @@ -181,68 +166,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE -static void render_logo(void) { - oled_write_P(m65_logo, false); -} - -void user_oled_magic(void) { - // Host Keyboard Layer Status - oled_write_P(PSTR("Layer: "), false); - - switch (get_highest_layer(layer_state)) { - case _QW: - oled_write_P(PSTR("Default\n"), false); - break; - case _LWR: - oled_write_P(PSTR("Lower\n"), false); - break; - case _RSE: - oled_write_P(PSTR("Raise\n"), false); - break; - case _ADJ: - oled_write_P(PSTR("ADJ\n"), false); - break; - default: - // Or use the write_ln shortcut over adding '\n' to the end of your string - oled_write_ln_P(PSTR("Undefined"), false); - } - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); -#ifdef WPM_ENABLE - oled_write_P(PSTR("\nwpm: "), false); - uint8_t wpm = get_current_wpm(); - oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); -#endif -} - oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -void clear_screen(void) { - if (clear_logo){ - for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { - for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { - oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); - } - } - clear_logo = false; - } -} - -# define SHOW_LOGO 5000 -bool oled_task_user(void) { - if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ - render_logo(); - }else{ - clear_screen(); - user_oled_magic(); +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; } - return false; + return true; } #endif diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index ffdb77f2ebb5..ed543498a84c 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -18,24 +18,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H #include "keymap_danish.h" -enum layer_names { - _QW = 0, - _LWR, - _RSE, - _ADJ -}; - -#ifdef OLED_ENABLE -static uint32_t oled_logo_timer = 0; -static bool clear_logo = true; -static const char PROGMEM m65_logo[] = { - 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 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, - 0}; -#endif - #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -142,6 +124,9 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { void keyboard_post_init_user(void) { // Enable the LED layers rgblight_layers = my_rgb_layers; +#ifdef OLED_ENABLE + init_timer(); +#endif } #endif @@ -182,68 +167,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE -static void render_logo(void) { - oled_write_P(m65_logo, false); -} - -void user_oled_magic(void) { - // Host Keyboard Layer Status - oled_write_P(PSTR("Layer: "), false); - - switch (get_highest_layer(layer_state)) { - case _QW: - oled_write_P(PSTR("Default\n"), false); - break; - case _LWR: - oled_write_P(PSTR("Lower\n"), false); - break; - case _RSE: - oled_write_P(PSTR("Raise\n"), false); - break; - case _ADJ: - oled_write_P(PSTR("ADJ\n"), false); - break; - default: - // Or use the write_ln shortcut over adding '\n' to the end of your string - oled_write_ln_P(PSTR("Undefined"), false); - } - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); -#ifdef WPM_ENABLE - oled_write_P(PSTR("\nwpm: "), false); - uint8_t wpm = get_current_wpm(); - oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); -#endif -} - oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -void clear_screen(void) { - if (clear_logo){ - for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { - for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { - oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); - } - } - clear_logo = false; - } -} - -# define SHOW_LOGO 5000 -bool oled_task_user(void) { - if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ - render_logo(); - }else{ - clear_screen(); - user_oled_magic(); +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; } - return false; + return true; } #endif diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index b140ca08c679..d8808369d844 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -18,30 +18,12 @@ along with this program. If not, see . #include QMK_KEYBOARD_H #include "keymap_uk.h" -enum layer_names { - _QW = 0, - _LWR, - _RSE, - _ADJ -}; - #ifdef CONSOLE_ENABLE #include "print.h" #endif -#ifdef OLED_ENABLE -static uint32_t oled_logo_timer = 0; -static bool clear_logo = true; -static const char PROGMEM m65_logo[] = { - 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 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, - 0}; -#endif - #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -345,8 +327,9 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { void keyboard_post_init_user(void) { // Enable the LED layers rgblight_layers = my_rgb_layers; + #ifdef OLED_ENABLE - oled_logo_timer = timer_read32(); + init_timer(); #endif #ifdef CONSOLE_ENABLE @@ -395,68 +378,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE -static void render_logo(void) { - oled_write_P(m65_logo, false); -} - -void user_oled_magic(void) { - // Host Keyboard Layer Status - oled_write_P(PSTR("Layer: "), false); - - switch (get_highest_layer(layer_state)) { - case _QW: - oled_write_P(PSTR("Default\n"), false); - break; - case _LWR: - oled_write_P(PSTR("Lower\n"), false); - break; - case _RSE: - oled_write_P(PSTR("Raise\n"), false); - break; - case _ADJ: - oled_write_P(PSTR("ADJ\n"), false); - break; - default: - // Or use the write_ln shortcut over adding '\n' to the end of your string - oled_write_ln_P(PSTR("Undefined"), false); - } - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); -#ifdef WPM_ENABLE - oled_write_P(PSTR("\nwpm: "), false); - uint8_t wpm = get_current_wpm(); - oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); -#endif -} - oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -void clear_screen(void) { - if (clear_logo){ - for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { - for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { - oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); - } - } - clear_logo = false; - } -} - -# define SHOW_LOGO 5000 -bool oled_task_user(void) { - if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ - render_logo(); - }else{ - clear_screen(); - user_oled_magic(); +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; } - return false; + return true; } #endif diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index f058c50fcb95..40450f41f111 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -17,24 +17,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -enum layer_names { - _QW = 0, - _LWR, - _RSE, - _ADJ -}; - -#ifdef OLED_ENABLE -static uint32_t oled_logo_timer = 0; -static bool clear_logo = true; -static const char PROGMEM m65_logo[] = { - 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 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, - 0}; -#endif - #ifdef RGBLIGHT_ENABLE const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); @@ -140,6 +122,9 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { void keyboard_post_init_user(void) { // Enable the LED layers rgblight_layers = my_rgb_layers; +#ifdef OLED_ENABLE + init_timer(); +#endif } #endif @@ -180,68 +165,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #ifdef OLED_ENABLE -static void render_logo(void) { - oled_write_P(m65_logo, false); -} - -void user_oled_magic(void) { - // Host Keyboard Layer Status - oled_write_P(PSTR("Layer: "), false); - - switch (get_highest_layer(layer_state)) { - case _QW: - oled_write_P(PSTR("Default\n"), false); - break; - case _LWR: - oled_write_P(PSTR("Lower\n"), false); - break; - case _RSE: - oled_write_P(PSTR("Raise\n"), false); - break; - case _ADJ: - oled_write_P(PSTR("ADJ\n"), false); - break; - default: - // Or use the write_ln shortcut over adding '\n' to the end of your string - oled_write_ln_P(PSTR("Undefined"), false); - } - - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); - oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); - oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); -#ifdef WPM_ENABLE - oled_write_P(PSTR("\nwpm: "), false); - uint8_t wpm = get_current_wpm(); - oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); -#endif -} - oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -void clear_screen(void) { - if (clear_logo){ - for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { - for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { - oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); - } - } - clear_logo = false; - } -} - -# define SHOW_LOGO 5000 -bool oled_task_user(void) { - if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ - render_logo(); - }else{ - clear_screen(); - user_oled_magic(); +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; } - return false; + return true; } #endif diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 153359f3377d..89715bee80e6 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -16,3 +16,81 @@ along with this program. If not, see . */ #include "m65.h" + +#ifdef OLED_ENABLE +static uint32_t oled_logo_timer = 0; +static bool clear_logo = true; +static const char PROGMEM m65_logo[] = { + 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, + 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, + 0}; + +void init_timer(void){ + oled_logo_timer = timer_read32(); +}; + +void user_oled_magic(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case _QW: + oled_write_P(PSTR("Default\n"), false); + break; + case _LWR: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RSE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJ: + oled_write_P(PSTR("ADJ\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("Lower ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("Raise ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CapsLock ") : PSTR(" "), false); +#ifdef WPM_ENABLE + oled_write_P(PSTR("\nwpm: "), false); + uint8_t wpm = get_current_wpm(); + oled_write_P(wpm != 0 ? get_u8_str(wpm,' ') : PSTR(" "), false); +#endif +} + +void render_logo(void) { + oled_write_P(m65_logo, false); +} + +void clear_screen(void) { + if (clear_logo){ + for (uint8_t i = 0; i < OLED_DISPLAY_HEIGHT; ++i) { + for (uint8_t j = 0; j < OLED_DISPLAY_WIDTH; ++j) { + oled_write_raw_byte(0x0, i*OLED_DISPLAY_WIDTH + j); + } + } + clear_logo = false; + } +} + + + +# define SHOW_LOGO 5000 +bool oled_task_user(void) { + if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ + render_logo(); + }else{ + clear_screen(); + user_oled_magic(); + } + return false; +} + +#endif diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index f5ffd519fa43..40c0aefa3aae 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -110,6 +110,22 @@ enum unicode_names { rT, }; + +enum layer_names { + _QW = 0, + _LWR, + _RSE, + _ADJ +}; + +#ifdef OLED_ENABLE +void user_oled_magic(void); +void render_logo(void); +void clear_screen(void); +void init_timer(void); +#endif + + static inline void led_lwr(const bool on) { #ifdef LED_NUM_LOCK_PIN writePin(LED_NUM_LOCK_PIN, on); From def650338e44bc5eb61e70a1b54cbfa3534f1203 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 08:02:17 +0000 Subject: [PATCH 06/25] make ifdefs nice and correct --- keyboards/mlego/m65/keymaps/default/keymap.c | 15 ++++++++++++++- keyboards/mlego/m65/keymaps/dk/keymap.c | 16 +++++++++++++++- keyboards/mlego/m65/keymaps/uk/keymap.c | 19 +++++++++++++++++-- keyboards/mlego/m65/keymaps/via/keymap.c | 15 ++++++++++++++- 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index 76131cba33d0..d71db44e0657 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -25,6 +25,7 @@ const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); + #endif // clang-format off @@ -102,6 +103,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { } layer_state_t layer_state_set_user(layer_state_t state) { + #ifdef RGBLIGHT_ENABLE rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); @@ -110,6 +112,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); #endif + return update_tri_layer_state(state, _LWR, _RSE, _ADJ); } @@ -120,14 +123,23 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +#endif + void keyboard_post_init_user(void) { + +#ifdef RGBLIGHT_ENABLE + // Enable the LED layers rgblight_layers = my_rgb_layers; + +#endif + #ifdef OLED_ENABLE + init_timer(); + #endif } -#endif #ifdef ENCODER_ENABLE @@ -162,6 +174,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { my_encoders(index, clockwise); return true; } + #endif #ifdef OLED_ENABLE diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index ed543498a84c..3955205d29c1 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -26,6 +26,7 @@ const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); + #endif // clang-format off @@ -103,6 +104,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { } layer_state_t layer_state_set_user(layer_state_t state) { + #ifdef RGBLIGHT_ENABLE rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); @@ -111,6 +113,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); #endif + return update_tri_layer_state(state, _LWR, _RSE, _ADJ); } @@ -121,14 +124,24 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +#endif + void keyboard_post_init_user(void) { + +#ifdef RGBLIGHT_ENABLE + // Enable the LED layers rgblight_layers = my_rgb_layers; + +#endif + #ifdef OLED_ENABLE + init_timer(); + #endif + } -#endif #ifdef ENCODER_ENABLE @@ -163,6 +176,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { my_encoders(index, clockwise); return true; } + #endif #ifdef OLED_ENABLE diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index d8808369d844..f481f846eff1 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -32,6 +32,7 @@ const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); + #endif const uint32_t PROGMEM unicode_map[] = { @@ -282,8 +283,11 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t* record) { + #ifdef CONSOLE_ENABLE + uprintf("KL: kc: 0x%04X, col: %u, row: %u, pressed: %b, time: %u, interrupt: %b, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); + #endif switch (keycode) { @@ -306,6 +310,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { } layer_state_t layer_state_set_user(layer_state_t state) { + #ifdef RGBLIGHT_ENABLE rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); @@ -314,6 +319,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); #endif + return update_tri_layer_state(state, _LWR, _RSE, _ADJ); } @@ -324,12 +330,20 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +#endif + void keyboard_post_init_user(void) { - // Enable the LED layers +#ifdef RGBLIGHT_ENABLE + + // Enable the LED layers rgblight_layers = my_rgb_layers; +#endif + #ifdef OLED_ENABLE + init_timer(); + #endif #ifdef CONSOLE_ENABLE @@ -337,9 +351,9 @@ void keyboard_post_init_user(void) { debug_enable = true; debug_matrix = true; debug_keyboard = true; + #endif } -#endif #ifdef ENCODER_ENABLE @@ -374,6 +388,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { my_encoders(index, clockwise); return true; } + #endif #ifdef OLED_ENABLE diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 40450f41f111..29ce491474c5 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -25,6 +25,7 @@ const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); + #endif // clang-format off @@ -101,6 +102,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { } layer_state_t layer_state_set_user(layer_state_t state) { + #ifdef RGBLIGHT_ENABLE rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); @@ -109,6 +111,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); #endif + return update_tri_layer_state(state, _LWR, _RSE, _ADJ); } @@ -119,14 +122,23 @@ layer_state_t default_layer_state_set_user(layer_state_t state) { return state; } +#endif + void keyboard_post_init_user(void) { + +#ifdef RGBLIGHT_ENABLE + // Enable the LED layers rgblight_layers = my_rgb_layers; + +#endif + #ifdef OLED_ENABLE + init_timer(); + #endif } -#endif #ifdef ENCODER_ENABLE @@ -161,6 +173,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { my_encoders(index, clockwise); return true; } + #endif #ifdef OLED_ENABLE From 364387c87323bc19890664e9f5ba8393381f3c5d Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 08:30:13 +0000 Subject: [PATCH 07/25] move the leds code out of keymap --- keyboards/mlego/m65/keymaps/default/keymap.c | 19 +++------- keyboards/mlego/m65/keymaps/dk/keymap.c | 19 +++------- keyboards/mlego/m65/keymaps/uk/keymap.c | 19 +++------- keyboards/mlego/m65/keymaps/via/keymap.c | 19 +++------- keyboards/mlego/m65/m65.c | 38 ++++++++++++++++++++ keyboards/mlego/m65/m65.h | 3 ++ 6 files changed, 61 insertions(+), 56 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index d71db44e0657..f409ca6cb769 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -62,24 +62,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on -// let us assume we start with both layers off -static bool toggle_lwr = false; -static bool toggle_rse = false; - bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. return false; } void matrix_scan_user(void) { - led_lwr(toggle_lwr); - led_rse(toggle_rse); - led_t led_state = host_keyboard_led_state(); - led_caps(led_state.caps_lock); - if (layer_state_is(_ADJ)) { - led_lwr(true); - led_rse(true); - } + + toggle_leds(); + } bool process_record_user(uint16_t keycode, keyrecord_t* record) { @@ -87,13 +78,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { case (TT(_LWR)): if (!record->event.pressed && record->tap.count == TAPPING_TOGGLE) { // This runs before the TT() handler toggles the layer state, so the current layer state is the opposite of the final one after toggle. - toggle_lwr = !layer_state_is(_LWR); + set_led_toggle(_LWR, !layer_state_is(_LWR)); } return true; break; case (TT(_RSE)): if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - toggle_rse = !layer_state_is(_RSE); + set_led_toggle(_RSE, !layer_state_is(_RSE)); } return true; break; diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index 3955205d29c1..5bc841f1315b 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -63,24 +63,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on -// let us assume we start with both layers off -static bool toggle_lwr = false; -static bool toggle_rse = false; - bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. return false; } void matrix_scan_user(void) { - led_lwr(toggle_lwr); - led_rse(toggle_rse); - led_t led_state = host_keyboard_led_state(); - led_caps(led_state.caps_lock); - if (layer_state_is(_ADJ)) { - led_lwr(true); - led_rse(true); - } + + toggle_leds(); + } bool process_record_user(uint16_t keycode, keyrecord_t* record) { @@ -88,13 +79,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { case (TT(_LWR)): if (!record->event.pressed && record->tap.count == TAPPING_TOGGLE) { // This runs before the TT() handler toggles the layer state, so the current layer state is the opposite of the final one after toggle. - toggle_lwr = !layer_state_is(_LWR); + set_led_toggle(_LWR, !layer_state_is(_LWR)); } return true; break; case (TT(_RSE)): if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - toggle_rse = !layer_state_is(_RSE); + set_led_toggle(_RSE, !layer_state_is(_RSE)); } return true; break; diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index f481f846eff1..f69591dae287 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -262,24 +262,15 @@ adj layer }; // clang-format on -// let us assume we start with both layers off -static bool toggle_lwr = false; -static bool toggle_rse = false; - bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. return false; } void matrix_scan_user(void) { - led_lwr(toggle_lwr); - led_rse(toggle_rse); - led_t led_state = host_keyboard_led_state(); - led_caps(led_state.caps_lock); - if (layer_state_is(_ADJ)) { - led_lwr(true); - led_rse(true); - } + + toggle_leds(); + } bool process_record_user(uint16_t keycode, keyrecord_t* record) { @@ -294,13 +285,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { case (TT(_LWR)): if (!record->event.pressed && record->tap.count == TAPPING_TOGGLE) { // This runs before the TT() handler toggles the layer state, so the current layer state is the opposite of the final one after toggle. - toggle_lwr = !layer_state_is(_LWR); + set_led_toggle(_LWR, !layer_state_is(_LWR)); } return true; break; case (TT(_RSE)): if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - toggle_rse = !layer_state_is(_RSE); + set_led_toggle(_RSE, !layer_state_is(_RSE)); } return true; break; diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 29ce491474c5..21df700ad245 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -61,24 +61,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // clang-format on -// let us assume we start with both layers off -static bool toggle_lwr = false; -static bool toggle_rse = false; - bool led_update_user(led_t led_state) { // Disable the default LED update code, so that lock LEDs could be reused to show layer status. return false; } void matrix_scan_user(void) { - led_lwr(toggle_lwr); - led_rse(toggle_rse); - led_t led_state = host_keyboard_led_state(); - led_caps(led_state.caps_lock); - if (layer_state_is(_ADJ)) { - led_lwr(true); - led_rse(true); - } + + toggle_leds(); + } bool process_record_user(uint16_t keycode, keyrecord_t* record) { @@ -86,13 +77,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) { case (TT(_LWR)): if (!record->event.pressed && record->tap.count == TAPPING_TOGGLE) { // This runs before the TT() handler toggles the layer state, so the current layer state is the opposite of the final one after toggle. - toggle_lwr = !layer_state_is(_LWR); + set_led_toggle(_LWR, !layer_state_is(_LWR)); } return true; break; case (TT(_RSE)): if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - toggle_rse = !layer_state_is(_RSE); + set_led_toggle(_RSE, !layer_state_is(_RSE)); } return true; break; diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 89715bee80e6..a94f48e79ad0 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -17,7 +17,12 @@ along with this program. If not, see . #include "m65.h" +// let us assume we start with both layers off +static bool toggle_lwr = false; +static bool toggle_rse = false; + #ifdef OLED_ENABLE + static uint32_t oled_logo_timer = 0; static bool clear_logo = true; static const char PROGMEM m65_logo[] = { @@ -27,6 +32,39 @@ static const char PROGMEM m65_logo[] = { 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0}; +#endif + + +void set_led_toggle(const uint8_t layer, const bool state){ + + switch (layer) { + case _LWR: + toggle_lwr = state; + break; + case _RSE: + toggle_rse = state; + break; + default: + break; + } +} + +void toggle_leds(void){ + + led_lwr(toggle_lwr); + led_rse(toggle_rse); + led_t led_state = host_keyboard_led_state(); + led_caps(led_state.caps_lock); + if (layer_state_is(_ADJ)) { + led_lwr(true); + led_rse(true); + } + +} + + +#ifdef OLED_ENABLE + void init_timer(void){ oled_logo_timer = timer_read32(); }; diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index 40c0aefa3aae..5c7187c1194e 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -126,6 +126,9 @@ void init_timer(void); #endif +void toggle_leds(void); +void set_led_toggle(const uint8_t, const bool); + static inline void led_lwr(const bool on) { #ifdef LED_NUM_LOCK_PIN writePin(LED_NUM_LOCK_PIN, on); From a808813feb688698f628278b4a698fe3224dc97b Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 09:49:43 +0000 Subject: [PATCH 08/25] try to reduce code duplication --- keyboards/mlego/m65/keymaps/default/keymap.c | 30 ++-------------- keyboards/mlego/m65/keymaps/dk/keymap.c | 30 ++-------------- keyboards/mlego/m65/keymaps/uk/keymap.c | 30 ++-------------- keyboards/mlego/m65/keymaps/via/keymap.c | 30 ++-------------- keyboards/mlego/m65/m65.c | 37 ++++++++++++++++++-- keyboards/mlego/m65/m65.h | 5 +++ 6 files changed, 52 insertions(+), 110 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index f409ca6cb769..f8b23e569371 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -134,35 +134,11 @@ void keyboard_post_init_user(void) { #ifdef ENCODER_ENABLE -# define MEDIA_KEY_DELAY 10 - -static inline void my_encoders(const uint8_t index, const bool clockwise) { - if (index == 0) { /* First encoder */ - if (IS_LAYER_ON(_LWR)) { - if (clockwise) { - rgblight_decrease_val_noeeprom(); - } else { - rgblight_increase_val_noeeprom(); - } - } else if (IS_LAYER_ON(_RSE)) { - if (clockwise) { - rgblight_decrease_hue_noeeprom(); - } else { - rgblight_increase_hue_noeeprom(); - } +bool encoder_update_kb(uint8_t index, bool clockwise) { - } else { - if (clockwise) { - tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); - } else { - tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); - } - } + if (!encoder_update_user(index,clockwise)) { + return false; } -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - my_encoders(index, clockwise); return true; } diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index 5bc841f1315b..e5d230466655 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -136,35 +136,11 @@ void keyboard_post_init_user(void) { #ifdef ENCODER_ENABLE -# define MEDIA_KEY_DELAY 10 - -static inline void my_encoders(const uint8_t index, const bool clockwise) { - if (index == 0) { /* First encoder */ - if (IS_LAYER_ON(_LWR)) { - if (clockwise) { - rgblight_decrease_val_noeeprom(); - } else { - rgblight_increase_val_noeeprom(); - } - } else if (IS_LAYER_ON(_RSE)) { - if (clockwise) { - rgblight_decrease_hue_noeeprom(); - } else { - rgblight_increase_hue_noeeprom(); - } +bool encoder_update_kb(uint8_t index, bool clockwise) { - } else { - if (clockwise) { - tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); - } else { - tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); - } - } + if (!encoder_update_user(index,clockwise)) { + return false; } -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - my_encoders(index, clockwise); return true; } diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index f69591dae287..7c2e7d856873 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -348,35 +348,11 @@ void keyboard_post_init_user(void) { #ifdef ENCODER_ENABLE -# define MEDIA_KEY_DELAY 10 - -static inline void my_encoders(const uint8_t index, const bool clockwise) { - if (index == 0) { /* First encoder */ - if (IS_LAYER_ON(_LWR)) { - if (clockwise) { - rgblight_decrease_val_noeeprom(); - } else { - rgblight_increase_val_noeeprom(); - } - } else if (IS_LAYER_ON(_RSE)) { - if (clockwise) { - rgblight_decrease_hue_noeeprom(); - } else { - rgblight_increase_hue_noeeprom(); - } +bool encoder_update_kb(uint8_t index, bool clockwise) { - } else { - if (clockwise) { - tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); - } else { - tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); - } - } + if (!encoder_update_user(index,clockwise)) { + return false; } -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - my_encoders(index, clockwise); return true; } diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 21df700ad245..90555d6bd840 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -133,35 +133,11 @@ void keyboard_post_init_user(void) { #ifdef ENCODER_ENABLE -# define MEDIA_KEY_DELAY 10 - -static inline void my_encoders(const uint8_t index, const bool clockwise) { - if (index == 0) { /* First encoder */ - if (IS_LAYER_ON(_LWR)) { - if (clockwise) { - rgblight_decrease_val_noeeprom(); - } else { - rgblight_increase_val_noeeprom(); - } - } else if (IS_LAYER_ON(_RSE)) { - if (clockwise) { - rgblight_decrease_hue_noeeprom(); - } else { - rgblight_increase_hue_noeeprom(); - } +bool encoder_update_kb(uint8_t index, bool clockwise) { - } else { - if (clockwise) { - tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); - } else { - tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); - } - } + if (!encoder_update_user(index,clockwise)) { + return false; } -} - -bool encoder_update_user(uint8_t index, bool clockwise) { - my_encoders(index, clockwise); return true; } diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index a94f48e79ad0..4abd46e530a8 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -62,6 +62,41 @@ void toggle_leds(void){ } +#ifdef ENCODER_ENABLE + +# define MEDIA_KEY_DELAY 10 + +void my_encoders(const uint8_t index, const bool clockwise) { + if (index == 0) { /* First encoder */ + if (IS_LAYER_ON(_LWR)) { + if (clockwise) { + rgblight_decrease_val_noeeprom(); + } else { + rgblight_increase_val_noeeprom(); + } + } else if (IS_LAYER_ON(_RSE)) { + if (clockwise) { + rgblight_decrease_hue_noeeprom(); + } else { + rgblight_increase_hue_noeeprom(); + } + + } else { + if (clockwise) { + tap_code_delay(KC_VOLD, MEDIA_KEY_DELAY); + } else { + tap_code_delay(KC_VOLU, MEDIA_KEY_DELAY); + } + } + } +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + my_encoders(index, clockwise); + return false; +} + +#endif #ifdef OLED_ENABLE @@ -118,8 +153,6 @@ void clear_screen(void) { } } - - # define SHOW_LOGO 5000 bool oled_task_user(void) { if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index 5c7187c1194e..ea72b932b506 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -125,6 +125,11 @@ void clear_screen(void); void init_timer(void); #endif +#ifdef ENCODER_ENABLE +void my_encoders(const uint8_t, const bool); +bool encoder_update_user(uint8_t, bool); +#endif + void toggle_leds(void); void set_led_toggle(const uint8_t, const bool); From fa31b9d672a69e5df938ba09acff64f6156f833f Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 13:10:37 +0000 Subject: [PATCH 09/25] move the rgb code outside the keymaps for reuse --- keyboards/mlego/m65/keymaps/default/keymap.c | 20 ++----------- keyboards/mlego/m65/keymaps/dk/keymap.c | 20 ++----------- keyboards/mlego/m65/keymaps/uk/keymap.c | 21 +++---------- keyboards/mlego/m65/keymaps/via/keymap.c | 20 ++----------- keyboards/mlego/m65/m65.c | 31 ++++++++++++++++++++ keyboards/mlego/m65/m65.h | 6 ++++ 6 files changed, 50 insertions(+), 68 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index f8b23e569371..bf9311e38c6c 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -17,17 +17,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -#ifdef RGBLIGHT_ENABLE - -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); -const rgblight_segment_t PROGMEM my_lwr_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_CYAN}); -const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_RED}); -const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); - -const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); - -#endif - // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -97,10 +86,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); - rgblight_set_layer_state(1, layer_state_cmp(state, _LWR)); - rgblight_set_layer_state(2, layer_state_cmp(state, _RSE)); - rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); + set_rgb_layers(state); #endif @@ -110,7 +96,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE layer_state_t default_layer_state_set_user(layer_state_t state) { - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); + set_default_rgb_layers(state); return state; } @@ -121,7 +107,7 @@ void keyboard_post_init_user(void) { #ifdef RGBLIGHT_ENABLE // Enable the LED layers - rgblight_layers = my_rgb_layers; + rgblight_layers = my_rgb(); #endif diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index e5d230466655..a36ad7110ca7 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -18,17 +18,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H #include "keymap_danish.h" -#ifdef RGBLIGHT_ENABLE - -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); -const rgblight_segment_t PROGMEM my_lwr_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_CYAN}); -const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_RED}); -const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); - -const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); - -#endif - // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -98,10 +87,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); - rgblight_set_layer_state(1, layer_state_cmp(state, _LWR)); - rgblight_set_layer_state(2, layer_state_cmp(state, _RSE)); - rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); + set_rgb_layers(state); #endif @@ -111,7 +97,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE layer_state_t default_layer_state_set_user(layer_state_t state) { - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); + set_default_rgb_layers(state); return state; } @@ -122,7 +108,7 @@ void keyboard_post_init_user(void) { #ifdef RGBLIGHT_ENABLE // Enable the LED layers - rgblight_layers = my_rgb_layers; + rgblight_layers = my_rgb(); #endif diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 7c2e7d856873..78c2724b5bf5 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -24,17 +24,6 @@ along with this program. If not, see . #endif -#ifdef RGBLIGHT_ENABLE - -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); -const rgblight_segment_t PROGMEM my_lwr_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_CYAN}); -const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_RED}); -const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); - -const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); - -#endif - const uint32_t PROGMEM unicode_map[] = { [la] = 0x03B1 , // α [lA] = 0x0391 , // Α @@ -304,10 +293,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); - rgblight_set_layer_state(1, layer_state_cmp(state, _LWR)); - rgblight_set_layer_state(2, layer_state_cmp(state, _RSE)); - rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); + set_rgb_layers(state); #endif @@ -317,7 +303,8 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE layer_state_t default_layer_state_set_user(layer_state_t state) { - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); + + set_default_rgb_layers(state); return state; } @@ -327,7 +314,7 @@ void keyboard_post_init_user(void) { #ifdef RGBLIGHT_ENABLE // Enable the LED layers - rgblight_layers = my_rgb_layers; + rgblight_layers = my_rgb(); #endif diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 90555d6bd840..345842495aac 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -17,17 +17,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -#ifdef RGBLIGHT_ENABLE - -const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); -const rgblight_segment_t PROGMEM my_lwr_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_CYAN}); -const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_RED}); -const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); - -const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); - -#endif - // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -96,10 +85,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); - rgblight_set_layer_state(1, layer_state_cmp(state, _LWR)); - rgblight_set_layer_state(2, layer_state_cmp(state, _RSE)); - rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); + set_rgb_layers(state); #endif @@ -109,7 +95,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { #ifdef RGBLIGHT_ENABLE layer_state_t default_layer_state_set_user(layer_state_t state) { - rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); + set_default_rgb_layers(state); return state; } @@ -120,7 +106,7 @@ void keyboard_post_init_user(void) { #ifdef RGBLIGHT_ENABLE // Enable the LED layers - rgblight_layers = my_rgb_layers; + rgblight_layers = my_rgb(); #endif diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 4abd46e530a8..949d070ccffa 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -21,6 +21,17 @@ along with this program. If not, see . static bool toggle_lwr = false; static bool toggle_rse = false; +#ifdef RGBLIGHT_ENABLE + +const rgblight_segment_t PROGMEM my_qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_PURPLE}); +const rgblight_segment_t PROGMEM my_lwr_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_CYAN}); +const rgblight_segment_t PROGMEM my_rse_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_RED}); +const rgblight_segment_t PROGMEM my_adj_layer[] = RGBLIGHT_LAYER_SEGMENTS({0, RGBLED_NUM, HSV_GREEN}); + +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_qwerty_layer, my_lwr_layer, my_rse_layer, my_adj_layer); + +#endif + #ifdef OLED_ENABLE static uint32_t oled_logo_timer = 0; @@ -34,6 +45,26 @@ static const char PROGMEM m65_logo[] = { #endif +#ifdef RGBLIGHT_ENABLE + +void set_rgb_layers(layer_state_t state){ + + rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); + rgblight_set_layer_state(1, layer_state_cmp(state, _LWR)); + rgblight_set_layer_state(2, layer_state_cmp(state, _RSE)); + rgblight_set_layer_state(3, layer_state_cmp(state, _ADJ)); + +} + +void set_default_rgb_layers(layer_state_t state){ + rgblight_set_layer_state(0, layer_state_cmp(state, _QW)); +} + +const rgblight_segment_t * const* my_rgb(void){ + return my_rgb_layers; +} + +#endif void set_led_toggle(const uint8_t layer, const bool state){ diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index ea72b932b506..d9d8b4e633e1 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -130,6 +130,12 @@ void my_encoders(const uint8_t, const bool); bool encoder_update_user(uint8_t, bool); #endif +#ifdef RGBLIGHT_ENABLE +void set_rgb_layers(layer_state_t); +const rgblight_segment_t * const* my_rgb(void); +void set_default_rgb_layers(layer_state_t); +#endif + void toggle_leds(void); void set_led_toggle(const uint8_t, const bool); From ae8a6a15186b330fdd41313426ea95d6d247d808 Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Sun, 6 Feb 2022 16:53:02 +0000 Subject: [PATCH 10/25] Update keyboards/mlego/m65/m65.c Co-authored-by: Drashna Jaelre --- keyboards/mlego/m65/m65.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 949d070ccffa..968cda96696c 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -122,7 +122,8 @@ void my_encoders(const uint8_t index, const bool clockwise) { } } -bool encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } my_encoders(index, clockwise); return false; } From f9667a0526434b65bb4d4b2a27818758072acbe7 Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Sun, 6 Feb 2022 16:53:20 +0000 Subject: [PATCH 11/25] Update keyboards/mlego/m65/m65.c Co-authored-by: Drashna Jaelre --- keyboards/mlego/m65/m65.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 968cda96696c..70ee6ab41390 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -186,7 +186,8 @@ void clear_screen(void) { } # define SHOW_LOGO 5000 -bool oled_task_user(void) { +bool oled_task_kb(void) { + if (!oled_task_user()) { return false; } if ((timer_elapsed32(oled_logo_timer) < SHOW_LOGO)){ render_logo(); }else{ From 8c1b224ca116bc487bac14286f54538ae7217c5f Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 6 Feb 2022 17:03:54 +0000 Subject: [PATCH 12/25] move more code outside keymaps for reuse --- keyboards/mlego/m65/keymaps/default/keymap.c | 27 -------------------- keyboards/mlego/m65/keymaps/dk/keymap.c | 27 -------------------- keyboards/mlego/m65/keymaps/uk/keymap.c | 27 -------------------- keyboards/mlego/m65/keymaps/via/keymap.c | 27 -------------------- keyboards/mlego/m65/m65.c | 4 +++ 5 files changed, 4 insertions(+), 108 deletions(-) diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index bf9311e38c6c..d497d9c81e90 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -117,30 +117,3 @@ void keyboard_post_init_user(void) { #endif } - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index,clockwise)) { - return false; - } - return true; -} - -#endif - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} - -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - return true; -} - -#endif diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index a36ad7110ca7..0b79aae43250 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -119,30 +119,3 @@ void keyboard_post_init_user(void) { #endif } - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index,clockwise)) { - return false; - } - return true; -} - -#endif - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} - -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - return true; -} - -#endif diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 78c2724b5bf5..4035cf353b9f 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -332,30 +332,3 @@ void keyboard_post_init_user(void) { #endif } - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index,clockwise)) { - return false; - } - return true; -} - -#endif - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} - -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - return true; -} - -#endif diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 345842495aac..1ad42858f6a3 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -116,30 +116,3 @@ void keyboard_post_init_user(void) { #endif } - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index,clockwise)) { - return false; - } - return true; -} - -#endif - -#ifdef OLED_ENABLE - -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} - -bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - return true; -} - -#endif diff --git a/keyboards/mlego/m65/m65.c b/keyboards/mlego/m65/m65.c index 70ee6ab41390..3f71a27790bc 100644 --- a/keyboards/mlego/m65/m65.c +++ b/keyboards/mlego/m65/m65.c @@ -185,6 +185,10 @@ void clear_screen(void) { } } +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + # define SHOW_LOGO 5000 bool oled_task_kb(void) { if (!oled_task_user()) { return false; } From dc6697688611ec297df30539124e0a8089e41ec5 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 13 Feb 2022 10:24:03 +0000 Subject: [PATCH 13/25] add few more xps --- keyboards/mlego/m65/m65.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index d9d8b4e633e1..1cde3daa18d6 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -108,6 +108,12 @@ enum unicode_names { rS, rt, rT, + ro, + rO, + ra2, + rA2, + ra3, + rA3 }; From a647d849c1eaba3cc04b98c731a9af24b04b0308 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Sun, 22 May 2022 11:16:24 +0100 Subject: [PATCH 14/25] add mic mute --- keyboards/mlego/m65/keymaps/uk/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 4035cf353b9f..50d7158d9605 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -226,7 +226,7 @@ raise layer shifted KC_ESC , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______,XP(ra1,rA1), _______, _______, _______,XP(rt,rT), _______, _______,XP(ri,rI), _______, _______, _______, _______ , KC_CAPS, XP(ra,rA), XP(rs,rS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , - _______, _______, _______, _______,XP(rc,rC), _______, _______, _______, _______, _______, _______, KC_WH_U, _______ , + _______, KC_F20 , _______, _______,XP(rc,rC), _______, _______, _______, _______, _______, _______, KC_WH_U, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R), /* adj layer From 6c9705d7797f19ef0f5c760585713e4e1b3e44ca Mon Sep 17 00:00:00 2001 From: alin m elena Date: Mon, 23 May 2022 09:06:18 +0100 Subject: [PATCH 15/25] update to new name of macros for reset --- keyboards/mlego/m48/keymaps/default/keymap.c | 2 +- keyboards/mlego/m48/keymaps/via/keymap.c | 2 +- keyboards/mlego/m60/keymaps/default/keymap.c | 2 +- keyboards/mlego/m60/keymaps/via/keymap.c | 2 +- keyboards/mlego/m60_split/keymaps/default/keymap.c | 2 +- keyboards/mlego/m60_split/keymaps/via/keymap.c | 2 +- keyboards/mlego/m65/keymaps/default/keymap.c | 2 +- keyboards/mlego/m65/keymaps/dk/keymap.c | 2 +- keyboards/mlego/m65/keymaps/uk/keymap.c | 2 +- keyboards/mlego/m65/keymaps/via/keymap.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/mlego/m48/keymaps/default/keymap.c b/keyboards/mlego/m48/keymaps/default/keymap.c index df9e1bb46ea3..c44ea7843d09 100644 --- a/keyboards/mlego/m48/keymaps/default/keymap.c +++ b/keyboards/mlego/m48/keymaps/default/keymap.c @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJ] = LAYOUT_ortho_4x12( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______,QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/mlego/m48/keymaps/via/keymap.c b/keyboards/mlego/m48/keymaps/via/keymap.c index af625ef207bd..3e903d6f8c1d 100644 --- a/keyboards/mlego/m48/keymaps/via/keymap.c +++ b/keyboards/mlego/m48/keymaps/via/keymap.c @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_4x12( - _______, RESET, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, RESET, _______, + _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/mlego/m60/keymaps/default/keymap.c b/keyboards/mlego/m60/keymaps/default/keymap.c index 18fdba688a9e..dca00eca268a 100644 --- a/keyboards/mlego/m60/keymaps/default/keymap.c +++ b/keyboards/mlego/m60/keymaps/default/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______, RESET, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, RESET, _______, + _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60/keymaps/via/keymap.c b/keyboards/mlego/m60/keymaps/via/keymap.c index 18fdba688a9e..dca00eca268a 100644 --- a/keyboards/mlego/m60/keymaps/via/keymap.c +++ b/keyboards/mlego/m60/keymaps/via/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______, RESET, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, RESET, _______, + _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60_split/keymaps/default/keymap.c b/keyboards/mlego/m60_split/keymaps/default/keymap.c index 5e3912b0bd9f..f2c79cdec0c6 100644 --- a/keyboards/mlego/m60_split/keymaps/default/keymap.c +++ b/keyboards/mlego/m60_split/keymaps/default/keymap.c @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x12( - _______, RESET , _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_M_G, RESET , _______, + _______, QK_BOOT , _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_M_G, QK_BOOT , _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, diff --git a/keyboards/mlego/m60_split/keymaps/via/keymap.c b/keyboards/mlego/m60_split/keymaps/via/keymap.c index ccb010474815..550a3bf46faa 100644 --- a/keyboards/mlego/m60_split/keymaps/via/keymap.c +++ b/keyboards/mlego/m60_split/keymaps/via/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______, RESET, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, RESET, _______, + _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index d497d9c81e90..1c5237acdba7 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index 0b79aae43250..54a19c6d5f9e 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD,RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T, RGB_M_SW , - RGB_HUI, RGB_HUD, RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______, RGB_M_SN , + RGB_HUI, RGB_HUD, RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______, RGB_M_SN , RGB_SAI, RGB_SAD, RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_K , RGB_VAI, RGB_VAD, RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_X , RGB_TOG, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 50d7158d9605..2032a4921fb7 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -244,7 +244,7 @@ adj layer */ [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 1ad42858f6a3..0eb0629fb876 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, RESET , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), From 2ebebb554765e59419083d87067f45971c69180e Mon Sep 17 00:00:00 2001 From: alin m elena Date: Mon, 23 May 2022 09:16:26 +0100 Subject: [PATCH 16/25] style for matrix --- keyboards/mlego/m48/keymaps/default/keymap.c | 8 ++++---- keyboards/mlego/m48/keymaps/via/keymap.c | 2 +- keyboards/mlego/m60/keymaps/default/keymap.c | 2 +- keyboards/mlego/m60/keymaps/via/keymap.c | 2 +- keyboards/mlego/m60_split/keymaps/default/keymap.c | 2 +- keyboards/mlego/m60_split/keymaps/via/keymap.c | 2 +- keyboards/mlego/m65/keymaps/default/keymap.c | 2 +- keyboards/mlego/m65/keymaps/dk/keymap.c | 2 +- keyboards/mlego/m65/keymaps/uk/keymap.c | 2 +- keyboards/mlego/m65/keymaps/via/keymap.c | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/keyboards/mlego/m48/keymaps/default/keymap.c b/keyboards/mlego/m48/keymaps/default/keymap.c index c44ea7843d09..8d99afd61ff4 100644 --- a/keyboards/mlego/m48/keymaps/default/keymap.c +++ b/keyboards/mlego/m48/keymaps/default/keymap.c @@ -106,10 +106,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJ] = LAYOUT_ortho_4x12( - _______,QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/mlego/m48/keymaps/via/keymap.c b/keyboards/mlego/m48/keymaps/via/keymap.c index 3e903d6f8c1d..773ed184bc04 100644 --- a/keyboards/mlego/m48/keymaps/via/keymap.c +++ b/keyboards/mlego/m48/keymaps/via/keymap.c @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_4x12( - _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/mlego/m60/keymaps/default/keymap.c b/keyboards/mlego/m60/keymaps/default/keymap.c index dca00eca268a..317d7b035506 100644 --- a/keyboards/mlego/m60/keymaps/default/keymap.c +++ b/keyboards/mlego/m60/keymaps/default/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60/keymaps/via/keymap.c b/keyboards/mlego/m60/keymaps/via/keymap.c index dca00eca268a..317d7b035506 100644 --- a/keyboards/mlego/m60/keymaps/via/keymap.c +++ b/keyboards/mlego/m60/keymaps/via/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60_split/keymaps/default/keymap.c b/keyboards/mlego/m60_split/keymaps/default/keymap.c index f2c79cdec0c6..7b9472ff7e99 100644 --- a/keyboards/mlego/m60_split/keymaps/default/keymap.c +++ b/keyboards/mlego/m60_split/keymaps/default/keymap.c @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x12( - _______, QK_BOOT , _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_M_G, QK_BOOT , _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_M_G, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, diff --git a/keyboards/mlego/m60_split/keymaps/via/keymap.c b/keyboards/mlego/m60_split/keymaps/via/keymap.c index 550a3bf46faa..756639bfd9c3 100644 --- a/keyboards/mlego/m60_split/keymaps/via/keymap.c +++ b/keyboards/mlego/m60_split/keymaps/via/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______,QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G,QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c index 1c5237acdba7..74f3c0faba55 100644 --- a/keyboards/mlego/m65/keymaps/default/keymap.c +++ b/keyboards/mlego/m65/keymaps/default/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/dk/keymap.c b/keyboards/mlego/m65/keymaps/dk/keymap.c index 54a19c6d5f9e..e44bf2adf258 100644 --- a/keyboards/mlego/m65/keymaps/dk/keymap.c +++ b/keyboards/mlego/m65/keymaps/dk/keymap.c @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD,RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T, RGB_M_SW , - RGB_HUI, RGB_HUD, RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______, RGB_M_SN , + RGB_HUI, RGB_HUD, RGB_M_P , _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_M_SN , RGB_SAI, RGB_SAD, RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_K , RGB_VAI, RGB_VAD, RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_X , RGB_TOG, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/uk/keymap.c b/keyboards/mlego/m65/keymaps/uk/keymap.c index 2032a4921fb7..3a4c6a4bc343 100644 --- a/keyboards/mlego/m65/keymaps/uk/keymap.c +++ b/keyboards/mlego/m65/keymaps/uk/keymap.c @@ -244,7 +244,7 @@ adj layer */ [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), diff --git a/keyboards/mlego/m65/keymaps/via/keymap.c b/keyboards/mlego/m65/keymaps/via/keymap.c index 0eb0629fb876..abf4c185f4b1 100644 --- a/keyboards/mlego/m65/keymaps/via/keymap.c +++ b/keyboards/mlego/m65/keymaps/via/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJ] = LAYOUT_ortho_5x13( RGB_MOD, RGB_RMOD, A(KC_F2), _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_T , RGB_M_SW, - RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT , _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, + RGB_HUI, RGB_HUD , RGB_M_P , _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______ , RGB_M_SN, RGB_SAI, RGB_SAD , RGB_M_B , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_K , RGB_VAI, RGB_VAD , RGB_M_R , _______, _______, _______, _______, _______, _______, _______, _______, _______ , RGB_M_X , RGB_TOG, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, RGB_M_TW, RGB_M_G), From 78966d968f33877f2e1428b82911d07a87921a96 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Tue, 31 May 2022 22:05:53 +0100 Subject: [PATCH 17/25] clean split --- keyboards/mlego/m60/keymaps/default/keymap.c | 2 +- keyboards/mlego/m60_split/keymaps/via/keymap.c | 2 +- keyboards/mlego/m60_split/rev1/config.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/mlego/m60/keymaps/default/keymap.c b/keyboards/mlego/m60/keymaps/default/keymap.c index 8d0cddae80ff..dbfcad315254 100644 --- a/keyboards/mlego/m60/keymaps/default/keymap.c +++ b/keyboards/mlego/m60/keymaps/default/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60_split/keymaps/via/keymap.c b/keyboards/mlego/m60_split/keymaps/via/keymap.c index dc0263c287fc..756639bfd9c3 100644 --- a/keyboards/mlego/m60_split/keymaps/via/keymap.c +++ b/keyboards/mlego/m60_split/keymaps/via/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_ADJ] = LAYOUT_ortho_5x12( - _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, + _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/mlego/m60_split/rev1/config.h b/keyboards/mlego/m60_split/rev1/config.h index 6b7923ac1207..c7578f19c642 100644 --- a/keyboards/mlego/m60_split/rev1/config.h +++ b/keyboards/mlego/m60_split/rev1/config.h @@ -19,7 +19,7 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x0001 +#define DEVICE_VER 0x6081 #define MATRIX_ROW_PINS \ { B0, A6, A7, B1, A5 } From f49b2687bf82848256509b84d4262b51da267e26 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Wed, 1 Jun 2022 12:06:21 +0100 Subject: [PATCH 18/25] use tinyuf2 as bootloader --- keyboards/mlego/m65/rev4/config.h | 3 +++ keyboards/mlego/m65/rev4/rules.mk | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h index 48950c084eeb..10f33f91e48a 100644 --- a/keyboards/mlego/m65/rev4/config.h +++ b/keyboards/mlego/m65/rev4/config.h @@ -65,3 +65,6 @@ along with this program. If not, see . #define OLED_BRIGHTNESS 128 #define OLED_FONT_H "keyboards/mlego/m65/lib/glcdfont.c" #endif + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m65/rev4/rules.mk b/keyboards/mlego/m65/rev4/rules.mk index 9e1e0ab23bc1..bef2c9a60236 100644 --- a/keyboards/mlego/m65/rev4/rules.mk +++ b/keyboards/mlego/m65/rev4/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER=tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable From 5a3ed7c3edcde5b0f8da6ca2dcae38f5bbe86876 Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Thu, 2 Jun 2022 09:07:55 +0100 Subject: [PATCH 19/25] Update keyboards/mlego/m65/rev4/rules.mk Co-authored-by: Ryan --- keyboards/mlego/m65/rev4/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mlego/m65/rev4/rules.mk b/keyboards/mlego/m65/rev4/rules.mk index bef2c9a60236..f9580b6d85bd 100644 --- a/keyboards/mlego/m65/rev4/rules.mk +++ b/keyboards/mlego/m65/rev4/rules.mk @@ -2,7 +2,7 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER=tinyuf2 +BOOTLOADER = tinyuf2 #BOOTLOADER = stm32-dfu # Build Options From 57b36b5f6d3d10ac8274de4d9e9a5d1930bf71e6 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Thu, 2 Jun 2022 09:42:23 +0100 Subject: [PATCH 20/25] radionalise product id and device version --- keyboards/mlego/m48/m48.c | 13 ------------- keyboards/mlego/m48/rev1/config.h | 2 +- keyboards/mlego/m60/m60.c | 13 ------------- keyboards/mlego/m60/m60.h | 5 ----- keyboards/mlego/m60/rev1/config.h | 2 +- keyboards/mlego/m60_split/rev1/config.h | 4 ++-- keyboards/mlego/m60_split/rev2/config.h | 2 +- keyboards/mlego/m65/m65.h | 7 +++---- keyboards/mlego/m65/rev2/config.h | 2 +- keyboards/mlego/m65/rev3/config.h | 4 ++-- keyboards/mlego/m65/rev4/config.h | 4 ++-- 11 files changed, 13 insertions(+), 45 deletions(-) diff --git a/keyboards/mlego/m48/m48.c b/keyboards/mlego/m48/m48.c index 79ba408cd908..887521075bc1 100644 --- a/keyboards/mlego/m48/m48.c +++ b/keyboards/mlego/m48/m48.c @@ -15,16 +15,3 @@ */ #include "m48.h" -/* -void keyboard_pre_init_kb(void){ - - // Workaround for reversible pcb/mcu - palSetLineMode(C13, PAL_MODE_INPUT_PULLUP); - palSetLineMode(C15, PAL_MODE_INPUT_PULLUP); - palSetLineMode(B7, PAL_MODE_OUTPUT_OPENDRAIN); - palSetLineMode(A0, PAL_MODE_OUTPUT_OPENDRAIN); - palSetLineMode(A1, PAL_MODE_OUTPUT_OPENDRAIN); - - keyboard_pre_init_user(); - } -*/ diff --git a/keyboards/mlego/m48/rev1/config.h b/keyboards/mlego/m48/rev1/config.h index 4c43bcc93ac2..a2e89d00fd96 100644 --- a/keyboards/mlego/m48/rev1/config.h +++ b/keyboards/mlego/m48/rev1/config.h @@ -19,7 +19,7 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x6261 -#define DEVICE_VER 0x0003 +#define DEVICE_VER 0x0001 #define MATRIX_ROW_PINS \ { A6, A7, B0, B10 } diff --git a/keyboards/mlego/m60/m60.c b/keyboards/mlego/m60/m60.c index cce37837c62b..e5dba32cdf41 100644 --- a/keyboards/mlego/m60/m60.c +++ b/keyboards/mlego/m60/m60.c @@ -15,16 +15,3 @@ */ #include "m60.h" -/* -void keyboard_pre_init_kb(void){ - - // Workaround for reversible pcb/mcu - palSetLineMode(C13, PAL_MODE_INPUT_PULLUP); - palSetLineMode(C15, PAL_MODE_INPUT_PULLUP); - palSetLineMode(B7, PAL_MODE_OUTPUT_OPENDRAIN); - palSetLineMode(A0, PAL_MODE_OUTPUT_OPENDRAIN); - palSetLineMode(A1, PAL_MODE_OUTPUT_OPENDRAIN); - - keyboard_pre_init_user(); - } -*/ diff --git a/keyboards/mlego/m60/m60.h b/keyboards/mlego/m60/m60.h index 732b8d2e41af..70cdbef69a08 100644 --- a/keyboards/mlego/m60/m60.h +++ b/keyboards/mlego/m60/m60.h @@ -46,12 +46,7 @@ static inline void led_rse(const bool on) { } static inline void led_caps(const bool on) { #ifdef LED_CAPS_LOCK_PIN - if ((DEVICE_VER == 0x0001) || (DEVICE_VER == 0x0003)) { writePin(LED_CAPS_LOCK_PIN, !on); - } - if (DEVICE_VER == 0x0002) { - writePin(LED_CAPS_LOCK_PIN, on); - } #endif } diff --git a/keyboards/mlego/m60/rev1/config.h b/keyboards/mlego/m60/rev1/config.h index 226f413c2420..ee55585d095d 100644 --- a/keyboards/mlego/m60/rev1/config.h +++ b/keyboards/mlego/m60/rev1/config.h @@ -19,7 +19,7 @@ /* USB Device descriptor parameter */ #define PRODUCT_ID 0x6161 -#define DEVICE_VER 0x0003 +#define DEVICE_VER 0x0001 #define MATRIX_ROW_PINS \ { A6, A7, B0, B1, B10 } diff --git a/keyboards/mlego/m60_split/rev1/config.h b/keyboards/mlego/m60_split/rev1/config.h index c7578f19c642..d998fe75ecbd 100644 --- a/keyboards/mlego/m60_split/rev1/config.h +++ b/keyboards/mlego/m60_split/rev1/config.h @@ -18,8 +18,8 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define PRODUCT_ID 0x0001 -#define DEVICE_VER 0x6081 +#define PRODUCT_ID 0x6361 +#define DEVICE_VER 0x0001 #define MATRIX_ROW_PINS \ { B0, A6, A7, B1, A5 } diff --git a/keyboards/mlego/m60_split/rev2/config.h b/keyboards/mlego/m60_split/rev2/config.h index 1e45e86d06bb..f667c3444d49 100644 --- a/keyboards/mlego/m60_split/rev2/config.h +++ b/keyboards/mlego/m60_split/rev2/config.h @@ -18,7 +18,7 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define PRODUCT_ID 0x0001 +#define PRODUCT_ID 0x6362 #define DEVICE_VER 0x0001 #define MATRIX_ROW_PINS \ diff --git a/keyboards/mlego/m65/m65.h b/keyboards/mlego/m65/m65.h index 1cde3daa18d6..9564b3d5290c 100644 --- a/keyboards/mlego/m65/m65.h +++ b/keyboards/mlego/m65/m65.h @@ -159,11 +159,10 @@ static inline void led_rse(const bool on) { } static inline void led_caps(const bool on) { #ifdef LED_CAPS_LOCK_PIN - if ((DEVICE_VER == 0x0001) || (DEVICE_VER == 0x0003) || (DEVICE_VER == 0x0004)) { - writePin(LED_CAPS_LOCK_PIN, !on); - } - if (DEVICE_VER == 0x0002) { + if ((PRODUCT_ID == 0x6061) && (DEVICE_VER == 0x0002)) { writePin(LED_CAPS_LOCK_PIN, on); + } else { + writePin(LED_CAPS_LOCK_PIN, !on); } #endif } diff --git a/keyboards/mlego/m65/rev2/config.h b/keyboards/mlego/m65/rev2/config.h index 40ac047d7d9f..db13bbb2ad1a 100644 --- a/keyboards/mlego/m65/rev2/config.h +++ b/keyboards/mlego/m65/rev2/config.h @@ -18,7 +18,7 @@ along with this program. If not, see . #pragma once #define DEVICE_VER 0x0002 -#define PRODUCT_ID 0x6062 +#define PRODUCT_ID 0x6061 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 diff --git a/keyboards/mlego/m65/rev3/config.h b/keyboards/mlego/m65/rev3/config.h index 11bf1df0e160..97b42a7723fc 100644 --- a/keyboards/mlego/m65/rev3/config.h +++ b/keyboards/mlego/m65/rev3/config.h @@ -17,8 +17,8 @@ along with this program. If not, see . #pragma once -#define DEVICE_VER 0x0003 -#define PRODUCT_ID 0x6063 +#define DEVICE_VER 0x0001 +#define PRODUCT_ID 0x6062 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h index 10f33f91e48a..157ffbefc024 100644 --- a/keyboards/mlego/m65/rev4/config.h +++ b/keyboards/mlego/m65/rev4/config.h @@ -17,8 +17,8 @@ along with this program. If not, see . #pragma once -#define DEVICE_VER 0x0004 -#define PRODUCT_ID 0x6064 +#define DEVICE_VER 0x0002 +#define PRODUCT_ID 0x6062 #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 From 02e81b17fd28754f268d3c9dbe197dac70dee13f Mon Sep 17 00:00:00 2001 From: alin m elena Date: Fri, 3 Jun 2022 12:15:17 +0100 Subject: [PATCH 21/25] add tinyuf2 as default bootloader for stm32f4 --- keyboards/mlego/m48/rev1/config.h | 3 +++ keyboards/mlego/m48/rev1/rules.mk | 3 ++- keyboards/mlego/m60/rev1/config.h | 3 +++ keyboards/mlego/m60/rev1/rules.mk | 3 ++- keyboards/mlego/m60_split/rev1/config.h | 3 +++ keyboards/mlego/m60_split/rev1/rules.mk | 3 ++- keyboards/mlego/m60_split/rev2/config.h | 3 +++ keyboards/mlego/m60_split/rev2/rules.mk | 3 ++- keyboards/mlego/m65/rev3/config.h | 3 +++ keyboards/mlego/m65/rev3/rules.mk | 3 ++- 10 files changed, 25 insertions(+), 5 deletions(-) diff --git a/keyboards/mlego/m48/rev1/config.h b/keyboards/mlego/m48/rev1/config.h index a2e89d00fd96..0378bbfe2f18 100644 --- a/keyboards/mlego/m48/rev1/config.h +++ b/keyboards/mlego/m48/rev1/config.h @@ -56,3 +56,6 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m48/rev1/rules.mk b/keyboards/mlego/m48/rev1/rules.mk index 066cfd4f8e73..ad9997e9eceb 100644 --- a/keyboards/mlego/m48/rev1/rules.mk +++ b/keyboards/mlego/m48/rev1/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER = tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m60/rev1/config.h b/keyboards/mlego/m60/rev1/config.h index ee55585d095d..adebf50c47e6 100644 --- a/keyboards/mlego/m60/rev1/config.h +++ b/keyboards/mlego/m60/rev1/config.h @@ -56,3 +56,6 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m60/rev1/rules.mk b/keyboards/mlego/m60/rev1/rules.mk index a3ccf0102de1..281e3a29a140 100644 --- a/keyboards/mlego/m60/rev1/rules.mk +++ b/keyboards/mlego/m60/rev1/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER = tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m60_split/rev1/config.h b/keyboards/mlego/m60_split/rev1/config.h index d998fe75ecbd..5f2b3d796c03 100644 --- a/keyboards/mlego/m60_split/rev1/config.h +++ b/keyboards/mlego/m60_split/rev1/config.h @@ -84,3 +84,6 @@ #define BOOTMAGIC_LITE_COLUMN 0 #define BOOTMAGIC_LITE_ROW_RIGHT 5 #define BOOTMAGIC_LITE_COLUMN_RIGHT 0 + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m60_split/rev1/rules.mk b/keyboards/mlego/m60_split/rev1/rules.mk index 9e2c8d6570ac..d2413f5076df 100644 --- a/keyboards/mlego/m60_split/rev1/rules.mk +++ b/keyboards/mlego/m60_split/rev1/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER = tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m60_split/rev2/config.h b/keyboards/mlego/m60_split/rev2/config.h index f667c3444d49..112aceb01340 100644 --- a/keyboards/mlego/m60_split/rev2/config.h +++ b/keyboards/mlego/m60_split/rev2/config.h @@ -80,3 +80,6 @@ #define BOOTMAGIC_LITE_COLUMN 0 #define BOOTMAGIC_LITE_ROW_RIGHT 5 #define BOOTMAGIC_LITE_COLUMN_RIGHT 0 + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m60_split/rev2/rules.mk b/keyboards/mlego/m60_split/rev2/rules.mk index cb8f4bd951e4..f33294318cf4 100644 --- a/keyboards/mlego/m60_split/rev2/rules.mk +++ b/keyboards/mlego/m60_split/rev2/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F411 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER = tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m65/rev3/config.h b/keyboards/mlego/m65/rev3/config.h index 97b42a7723fc..a692919dbe47 100644 --- a/keyboards/mlego/m65/rev3/config.h +++ b/keyboards/mlego/m65/rev3/config.h @@ -57,3 +57,6 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 + +// you want to comment this if using stm32-dfu as bootloader +#define FEE_PAGE_BASE_ADDRESS 0x0800c000 diff --git a/keyboards/mlego/m65/rev3/rules.mk b/keyboards/mlego/m65/rev3/rules.mk index 25df19c15fa1..53e3615a8612 100644 --- a/keyboards/mlego/m65/rev3/rules.mk +++ b/keyboards/mlego/m65/rev3/rules.mk @@ -2,7 +2,8 @@ MCU = STM32F401 # Bootloader selection -BOOTLOADER = stm32-dfu +BOOTLOADER = tinyuf2 +#BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable From b37677670d7eb1d2af1ae0e8e36ec526a1051bd0 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Wed, 8 Jun 2022 11:30:25 +0100 Subject: [PATCH 22/25] update tinyuf2 --- keyboards/mlego/m65/rev4/config.h | 2 +- keyboards/mlego/m65/rev4/ld/STM32F401xE.ld | 88 ++++++++++++++++++++++ keyboards/mlego/m65/rev4/rules.mk | 2 + 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 keyboards/mlego/m65/rev4/ld/STM32F401xE.ld diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h index 157ffbefc024..500b94c61b1e 100644 --- a/keyboards/mlego/m65/rev4/config.h +++ b/keyboards/mlego/m65/rev4/config.h @@ -67,4 +67,4 @@ along with this program. If not, see . #endif // you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/keyboards/mlego/m65/rev4/ld/STM32F401xE.ld b/keyboards/mlego/m65/rev4/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mlego/m65/rev4/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mlego/m65/rev4/rules.mk b/keyboards/mlego/m65/rev4/rules.mk index f9580b6d85bd..bf4285383a0b 100644 --- a/keyboards/mlego/m65/rev4/rules.mk +++ b/keyboards/mlego/m65/rev4/rules.mk @@ -4,6 +4,8 @@ MCU = STM32F401 # Bootloader selection BOOTLOADER = tinyuf2 #BOOTLOADER = stm32-dfu +MCU_LDSCRIPT = STM32F401xE +EEPROM_DRIVER = vendor # Build Options # change yes to no to disable From 8b1479898f62a271ec842d4b9c6c9fb85109299f Mon Sep 17 00:00:00 2001 From: alin m elena Date: Thu, 9 Jun 2022 15:52:36 +0100 Subject: [PATCH 23/25] update tinyuf2 and via. f411 remove tinyuf2 since is not really working. make the config more conditional --- keyboards/mlego/m48/config.h | 3 + keyboards/mlego/m48/rev1/config.h | 18 ++-- keyboards/mlego/m48/rev1/ld/STM32F401xE.ld | 88 +++++++++++++++++++ keyboards/mlego/m48/rev1/rules.mk | 2 + keyboards/mlego/m60/config.h | 3 + keyboards/mlego/m60/rev1/config.h | 22 ++--- keyboards/mlego/m60/rev1/ld/STM32F401xE.ld | 88 +++++++++++++++++++ keyboards/mlego/m60/rev1/rules.mk | 2 + keyboards/mlego/m60_split/config.h | 2 + keyboards/mlego/m60_split/rev1/config.h | 19 ++-- .../mlego/m60_split/rev1/ld/STM32F401xE.ld | 88 +++++++++++++++++++ keyboards/mlego/m60_split/rev1/rules.mk | 2 + keyboards/mlego/m60_split/rev2/config.h | 19 ++-- keyboards/mlego/m60_split/rev2/rules.mk | 3 +- keyboards/mlego/m65/rev3/config.h | 14 +-- keyboards/mlego/m65/rev3/ld/STM32F401xE.ld | 88 +++++++++++++++++++ keyboards/mlego/m65/rev3/rules.mk | 2 + keyboards/mlego/m65/rev4/config.h | 13 +-- quantum/via.c | 4 +- 19 files changed, 425 insertions(+), 55 deletions(-) create mode 100644 keyboards/mlego/m48/rev1/ld/STM32F401xE.ld create mode 100644 keyboards/mlego/m60/rev1/ld/STM32F401xE.ld create mode 100644 keyboards/mlego/m60_split/rev1/ld/STM32F401xE.ld create mode 100644 keyboards/mlego/m65/rev3/ld/STM32F401xE.ld diff --git a/keyboards/mlego/m48/config.h b/keyboards/mlego/m48/config.h index d1c4da939729..879108d2387d 100644 --- a/keyboards/mlego/m48/config.h +++ b/keyboards/mlego/m48/config.h @@ -27,6 +27,9 @@ #define DEBOUNCE 5 +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/mlego/m48/rev1/config.h b/keyboards/mlego/m48/rev1/config.h index 0378bbfe2f18..dcca34c95e44 100644 --- a/keyboards/mlego/m48/rev1/config.h +++ b/keyboards/mlego/m48/rev1/config.h @@ -26,24 +26,21 @@ #define MATRIX_COL_PINS \ { A10, A15, B3, B4, B5, B7, B6, A1, A2, A3, A4, A5 } +#ifdef ENCODER_ENABLE #define ENCODERS_PAD_A \ { A0 } #define ENCODERS_PAD_B \ { B8 } +#define ENCODER_RESOLUTION 4 +#endif #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 #define LED_CAPS_LOCK_PIN C13 -#define RGB_DI_PIN B15 - -#define UNUSED_PINS +#ifdef RGBLIGHT_ENABLE #define RGBLIGHT_LAYERS - -/* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_IO_DELAY 5 +#define RGB_DI_PIN B15 #define RGBLED_NUM 20 #define RGBLIGHT_EFFECT_BREATHING @@ -57,5 +54,8 @@ #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE +#endif + +#define UNUSED_PINS // you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/keyboards/mlego/m48/rev1/ld/STM32F401xE.ld b/keyboards/mlego/m48/rev1/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mlego/m48/rev1/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mlego/m48/rev1/rules.mk b/keyboards/mlego/m48/rev1/rules.mk index ad9997e9eceb..da2734ff63c7 100644 --- a/keyboards/mlego/m48/rev1/rules.mk +++ b/keyboards/mlego/m48/rev1/rules.mk @@ -3,6 +3,8 @@ MCU = STM32F401 # Bootloader selection BOOTLOADER = tinyuf2 +MCU_LDSCRIPT = STM32F401xE +EEPROM_DRIVER = vendor #BOOTLOADER = stm32-dfu # Build Options diff --git a/keyboards/mlego/m60/config.h b/keyboards/mlego/m60/config.h index 18c36671a98e..abce0cb5f86a 100644 --- a/keyboards/mlego/m60/config.h +++ b/keyboards/mlego/m60/config.h @@ -25,6 +25,9 @@ #define MATRIX_ROWS 5 #define MATRIX_COLS 12 +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + #define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ diff --git a/keyboards/mlego/m60/rev1/config.h b/keyboards/mlego/m60/rev1/config.h index adebf50c47e6..437e60514914 100644 --- a/keyboards/mlego/m60/rev1/config.h +++ b/keyboards/mlego/m60/rev1/config.h @@ -21,6 +21,11 @@ #define PRODUCT_ID 0x6161 #define DEVICE_VER 0x0001 +#define LED_NUM_LOCK_PIN B12 +#define LED_SCROLL_LOCK_PIN B13 +#define LED_CAPS_LOCK_PIN C13 + +#ifdef ENCODER_ENABLE #define MATRIX_ROW_PINS \ { A6, A7, B0, B1, B10 } #define MATRIX_COL_PINS \ @@ -31,20 +36,13 @@ #define ENCODERS_PAD_B \ { B8 } -#define LED_NUM_LOCK_PIN B12 -#define LED_SCROLL_LOCK_PIN B13 -#define LED_CAPS_LOCK_PIN C13 +#endif -#define RGB_DI_PIN B15 +#ifdef RGBLIGHT_ENABLE -#define UNUSED_PINS +#define RGB_DI_PIN B15 #define RGBLIGHT_LAYERS -/* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_IO_DELAY 5 - #define RGBLED_NUM 20 #define RGBLIGHT_EFFECT_BREATHING #define RGBLIGHT_EFFECT_RAINBOW_MOOD @@ -56,6 +54,8 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE +#endif +#define UNUSED_PINS // you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/keyboards/mlego/m60/rev1/ld/STM32F401xE.ld b/keyboards/mlego/m60/rev1/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mlego/m60/rev1/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mlego/m60/rev1/rules.mk b/keyboards/mlego/m60/rev1/rules.mk index 281e3a29a140..6b119a1f3774 100644 --- a/keyboards/mlego/m60/rev1/rules.mk +++ b/keyboards/mlego/m60/rev1/rules.mk @@ -4,6 +4,8 @@ MCU = STM32F401 # Bootloader selection BOOTLOADER = tinyuf2 #BOOTLOADER = stm32-dfu +MCU_LDSCRIPT = STM32F401xE +EEPROM_DRIVER = vendor # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m60_split/config.h b/keyboards/mlego/m60_split/config.h index 7c19f9171d79..7282886b0ba0 100644 --- a/keyboards/mlego/m60_split/config.h +++ b/keyboards/mlego/m60_split/config.h @@ -26,6 +26,8 @@ #define MATRIX_COLS 6 #define DEBOUNCE 5 +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/mlego/m60_split/rev1/config.h b/keyboards/mlego/m60_split/rev1/config.h index 5f2b3d796c03..0bbb56aee09e 100644 --- a/keyboards/mlego/m60_split/rev1/config.h +++ b/keyboards/mlego/m60_split/rev1/config.h @@ -32,12 +32,14 @@ #define MATRIX_COL_PINS_RIGHT \ { B0, A3, A2, A1, B7, B5 } // cols are from right to left to match the layout +#ifdef ENCODER_ENABLE #define ENCODERS_PAD_A \ { A0 } #define ENCODERS_PAD_B \ { B8 } #define ENCODER_RESOLUTIONS \ { 4 } +#endif #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 @@ -46,20 +48,15 @@ #define SPLIT_LAYER_STATE_ENABLE #define SPLIT_LED_STATE_ENABLE -#define RGB_DI_PIN B15 #define SPLIT_HAND_PIN B9 #define SERIAL_USART_TX_PIN B6 -#define RGBLIGHT_SPLIT -#define RGBLIGHT_LAYERS - -#define UNUSED_PINS #define SERIAL_USART_SPEED 921600 -/* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_IO_DELAY 5 +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN B15 +#define RGBLIGHT_SPLIT +#define RGBLIGHT_LAYERS #define RGBLIGHT_LIMIT_VAL 128 #define RGBLIGHT_DEFAULT_HUE 213 @@ -84,6 +81,8 @@ #define BOOTMAGIC_LITE_COLUMN 0 #define BOOTMAGIC_LITE_ROW_RIGHT 5 #define BOOTMAGIC_LITE_COLUMN_RIGHT 0 +#endif +#define UNUSED_PINS // you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/keyboards/mlego/m60_split/rev1/ld/STM32F401xE.ld b/keyboards/mlego/m60_split/rev1/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mlego/m60_split/rev1/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mlego/m60_split/rev1/rules.mk b/keyboards/mlego/m60_split/rev1/rules.mk index d2413f5076df..14022f20865b 100644 --- a/keyboards/mlego/m60_split/rev1/rules.mk +++ b/keyboards/mlego/m60_split/rev1/rules.mk @@ -4,6 +4,8 @@ MCU = STM32F401 # Bootloader selection BOOTLOADER = tinyuf2 #BOOTLOADER = stm32-dfu +MCU_LDSCRIPT = STM32F401xE +EEPROM_DRIVER = vendor # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m60_split/rev2/config.h b/keyboards/mlego/m60_split/rev2/config.h index 112aceb01340..c5b011c4379b 100644 --- a/keyboards/mlego/m60_split/rev2/config.h +++ b/keyboards/mlego/m60_split/rev2/config.h @@ -32,6 +32,8 @@ #define MATRIX_COL_PINS_RIGHT \ { B0, A3, A2, A1, B7, B5 } // cols are from right to left to match the layout + +#ifdef ENCODER_ENABLE #define ENCODERS_PAD_A \ { A0 } #define ENCODERS_PAD_B \ @@ -39,28 +41,25 @@ #define ENCODER_RESOLUTIONS \ { 4 } +#endif + #define LED_NUM_LOCK_PIN B12 #define LED_SCROLL_LOCK_PIN B13 #define LED_CAPS_LOCK_PIN C13 #define SPLIT_LAYER_STATE_ENABLE #define SPLIT_LED_STATE_ENABLE -#define RGB_DI_PIN B15 #define SPLIT_HAND_PIN B9 #define SERIAL_USART_TX_PIN B6 -#define RGBLIGHT_SPLIT -#define UNUSED_PINS #define SERIAL_USART_SPEED 921600 -/* COL2ROW, ROW2COL*/ -#define DIODE_DIRECTION COL2ROW - -#define MATRIX_IO_DELAY 5 +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN B15 +#define RGBLIGHT_SPLIT #define RGBLIGHT_LAYERS - #define RGBLED_NUM 16 #define RGBLED_SPLIT \ { 8, 8 } @@ -74,6 +73,7 @@ #define RGBLIGHT_EFFECT_RGB_TEST #define RGBLIGHT_EFFECT_ALTERNATING #define RGBLIGHT_EFFECT_TWINKLE +#endif /* Bootmagic Lite key configuration */ #define BOOTMAGIC_LITE_ROW 0 @@ -81,5 +81,4 @@ #define BOOTMAGIC_LITE_ROW_RIGHT 5 #define BOOTMAGIC_LITE_COLUMN_RIGHT 0 -// you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define UNUSED_PINS diff --git a/keyboards/mlego/m60_split/rev2/rules.mk b/keyboards/mlego/m60_split/rev2/rules.mk index f33294318cf4..cb8f4bd951e4 100644 --- a/keyboards/mlego/m60_split/rev2/rules.mk +++ b/keyboards/mlego/m60_split/rev2/rules.mk @@ -2,8 +2,7 @@ MCU = STM32F411 # Bootloader selection -BOOTLOADER = tinyuf2 -#BOOTLOADER = stm32-dfu +BOOTLOADER = stm32-dfu # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m65/rev3/config.h b/keyboards/mlego/m65/rev3/config.h index a692919dbe47..a4b1ba334334 100644 --- a/keyboards/mlego/m65/rev3/config.h +++ b/keyboards/mlego/m65/rev3/config.h @@ -31,18 +31,18 @@ along with this program. If not, see . #define MATRIX_COL_PINS \ { A10, A15, B3, B4, B5, B9, B8, B7, A1, A2, A3, A4, B1 } +#ifdef ENCODER_ENABLE #define ENCODERS_PAD_A \ { A0 } #define ENCODERS_PAD_B \ { B6 } +#define ENCODER_RESOLUTION 4 +#endif -#define RGB_DI_PIN B15 +#ifdef RGBLIGHT_ENABLE -#define UNUSED_PINS +#define RGB_DI_PIN B15 #define RGBLIGHT_LAYERS - -#define ENCODER_RESOLUTION 4 - #undef RGBLED_NUM #define RGBLED_NUM 20 #define RGBLIGHT_EFFECT_BREATHING @@ -57,6 +57,8 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_TWINKLE #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 +#endif +#define UNUSED_PINS // you want to comment this if using stm32-dfu as bootloader -#define FEE_PAGE_BASE_ADDRESS 0x0800c000 +#define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/keyboards/mlego/m65/rev3/ld/STM32F401xE.ld b/keyboards/mlego/m65/rev3/ld/STM32F401xE.ld new file mode 100644 index 000000000000..daec7d858347 --- /dev/null +++ b/keyboards/mlego/m65/rev3/ld/STM32F401xE.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * STM32F401xE memory setup. + */ +MEMORY +{ + flash0 (rx) : org = 0x08000000, len = 16k /* tinyuf2 bootloader requires app to be located at 64k offset for this MCU */ + flash1 (rx) : org = 0x08004000, len = 16k + flash2 (rx) : org = 0x08008000, len = 16k /* emulated eeprom */ + flash3 (rx) : org = 0x0800C000, len = 16k + flash4 (rx) : org = 0x08010000, len = 512k - 64k + flash5 (rx) : org = 0x00000000, len = 0 + flash6 (rx) : org = 0x00000000, len = 0 + flash7 (rx) : org = 0x00000000, len = 0 + ram0 (wx) : org = 0x20000000, len = 96k + ram1 (wx) : org = 0x00000000, len = 0 + ram2 (wx) : org = 0x00000000, len = 0 + ram3 (wx) : org = 0x00000000, len = 0 + ram4 (wx) : org = 0x00000000, len = 0 + ram5 (wx) : org = 0x00000000, len = 0 + ram6 (wx) : org = 0x00000000, len = 0 + ram7 (wx) : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash4); +REGION_ALIAS("VECTORS_FLASH_LMA", flash4); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash4); +REGION_ALIAS("XTORS_FLASH_LMA", flash4); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash4); +REGION_ALIAS("TEXT_FLASH_LMA", flash4); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash4); +REGION_ALIAS("RODATA_FLASH_LMA", flash4); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash4); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash4); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash4); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash4); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld + +/* TinyUF2 bootloader reset support */ +_board_dfu_dbl_tap = ORIGIN(ram0) + 64k - 4; /* this is based off the linker file for tinyuf2 */ diff --git a/keyboards/mlego/m65/rev3/rules.mk b/keyboards/mlego/m65/rev3/rules.mk index 53e3615a8612..558accd5b15c 100644 --- a/keyboards/mlego/m65/rev3/rules.mk +++ b/keyboards/mlego/m65/rev3/rules.mk @@ -4,6 +4,8 @@ MCU = STM32F401 # Bootloader selection BOOTLOADER = tinyuf2 #BOOTLOADER = stm32-dfu +MCU_LDSCRIPT = STM32F401xE +EEPROM_DRIVER = vendor # Build Options # change yes to no to disable diff --git a/keyboards/mlego/m65/rev4/config.h b/keyboards/mlego/m65/rev4/config.h index 500b94c61b1e..07dd0fefaabb 100644 --- a/keyboards/mlego/m65/rev4/config.h +++ b/keyboards/mlego/m65/rev4/config.h @@ -31,18 +31,18 @@ along with this program. If not, see . #define MATRIX_COL_PINS \ { B14, A8, A10, A15, B3, B4, B5, B7, A1, A2, A3, A4, B1 } +#ifdef ENCODER_ENABLE #define ENCODERS_PAD_A \ { A0 } #define ENCODERS_PAD_B \ { B6 } +#define ENCODER_RESOLUTION 4 +#endif -#define RGB_DI_PIN B15 +#ifdef RGBLIGHT_ENABLE -#define UNUSED_PINS +#define RGB_DI_PIN B15 #define RGBLIGHT_LAYERS - -#define ENCODER_RESOLUTION 4 - #undef RGBLED_NUM #define RGBLED_NUM 20 #define RGBLIGHT_EFFECT_BREATHING @@ -58,6 +58,8 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 +#endif + #ifdef OLED_ENABLE # define OLED_DISPLAY_128X32 #define I2C1_SCL_PIN B9 @@ -66,5 +68,6 @@ along with this program. If not, see . #define OLED_FONT_H "keyboards/mlego/m65/lib/glcdfont.c" #endif +#define UNUSED_PINS // you want to comment this if using stm32-dfu as bootloader #define FEE_PAGE_BASE_ADDRESS 0x08008000 diff --git a/quantum/via.c b/quantum/via.c index 320bd5546dc1..71dcfa7f8561 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -72,7 +72,7 @@ void eeconfig_update_rgb_matrix(void); // Can be called in an overriding via_init_kb() to test if keyboard level code usage of // EEPROM is invalid and use/save defaults. bool via_eeprom_is_valid(void) { - char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + static const char p[20] = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F); @@ -83,7 +83,7 @@ bool via_eeprom_is_valid(void) { // Sets VIA/keyboard level usage of EEPROM to valid/invalid // Keyboard level code (eg. via_init_kb()) should not call this void via_eeprom_set_valid(bool valid) { - char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + static const char p[20] = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F); From 8e018a7572fd2bfd1573eab1a408f318a94fc0bf Mon Sep 17 00:00:00 2001 From: alin m elena Date: Fri, 10 Jun 2022 08:20:23 +0100 Subject: [PATCH 24/25] sync the keymap with default --- keyboards/mlego/m48/keymaps/via/keymap.c | 73 +++++++++++++++++++----- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/keyboards/mlego/m48/keymaps/via/keymap.c b/keyboards/mlego/m48/keymaps/via/keymap.c index 4e19343847a1..5eb40a332aba 100644 --- a/keyboards/mlego/m48/keymaps/via/keymap.c +++ b/keyboards/mlego/m48/keymaps/via/keymap.c @@ -39,32 +39,77 @@ const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(m // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ [_QW] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_TRNS,KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ [_LWR] = LAYOUT_ortho_4x12( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ [_RSE] = LAYOUT_ortho_4x12( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), +/* Adjust (Lower + Raise) + * v------------------------RGB CONTROL--------------------v + * ,-----------------------------------------------------------------------------------. + * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ [_ADJ] = LAYOUT_ortho_4x12( - _______, QK_BOOT, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_G, QK_BOOT, _______, - _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, - _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; From 06c50eca96e697d59b0bd7060ff10d4ab2258065 Mon Sep 17 00:00:00 2001 From: alin m elena Date: Fri, 10 Jun 2022 09:52:10 +0100 Subject: [PATCH 25/25] revert via non building with gcc 11 --- quantum/via.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/via.c b/quantum/via.c index 71dcfa7f8561..320bd5546dc1 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -72,7 +72,7 @@ void eeconfig_update_rgb_matrix(void); // Can be called in an overriding via_init_kb() to test if keyboard level code usage of // EEPROM is invalid and use/save defaults. bool via_eeprom_is_valid(void) { - static const char p[20] = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F); @@ -83,7 +83,7 @@ bool via_eeprom_is_valid(void) { // Sets VIA/keyboard level usage of EEPROM to valid/invalid // Keyboard level code (eg. via_init_kb()) should not call this void via_eeprom_set_valid(bool valid) { - static const char p[20] = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" + char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54" uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F); uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F); uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F);