From fcf8b804ed95a98561bd4c1d6c85604be0f7cc7b Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Mon, 3 Apr 2023 10:33:45 +0200 Subject: [Core] Refactor `keyevent_t` for 1ms timing resolution (#15847) --- keyboards/sofle/keymaps/keyhive_via/encoder.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'keyboards/sofle/keymaps') diff --git a/keyboards/sofle/keymaps/keyhive_via/encoder.c b/keyboards/sofle/keymaps/keyhive_via/encoder.c index 0883c4a48a..7775cb7b86 100644 --- a/keyboards/sofle/keymaps/keyhive_via/encoder.c +++ b/keyboards/sofle/keymaps/keyhive_via/encoder.c @@ -26,7 +26,7 @@ void encoder_action_unregister(void) { for (int index = 0; index < 2; ++index) { if (encoder_state[index]) { - keyevent_t encoder_event = (keyevent_t){.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, .time = (timer_read() | 1)}; + keyevent_t encoder_event = (keyevent_t){.key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, .time = timer_read(), .type = KEY_EVENT}; encoder_state[index] = 0; action_exec(encoder_event); } @@ -34,7 +34,7 @@ } void encoder_action_register(uint8_t index, bool clockwise) { - keyevent_t encoder_event = (keyevent_t){.key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, .time = (timer_read() | 1)}; + keyevent_t encoder_event = (keyevent_t){.key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, .time = timer_read(), .type = KEY_EVENT}; encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); } @@ -46,4 +46,3 @@ return false; }; #endif - -- cgit v1.2.3 From 47966dc2a65c88ac90fcd64d12243d72f3f6753b Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 6 Apr 2023 18:00:54 +1000 Subject: Migrate `rgblight.pin` and `RGB_DI_PIN` to `ws2812.pin` (#20303) --- keyboards/sofle/keymaps/bastien-baloup_fr/config.h | 2 +- keyboards/sofle/keymaps/devdev/config.h | 2 +- keyboards/sofle/keymaps/killmaster/config.h | 2 +- keyboards/sofle/keymaps/rgb_default/config.h | 2 +- keyboards/sofle/keymaps/via/config.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'keyboards/sofle/keymaps') diff --git a/keyboards/sofle/keymaps/bastien-baloup_fr/config.h b/keyboards/sofle/keymaps/bastien-baloup_fr/config.h index f15cd7b8fb..dd3b6d8f5a 100644 --- a/keyboards/sofle/keymaps/bastien-baloup_fr/config.h +++ b/keyboards/sofle/keymaps/bastien-baloup_fr/config.h @@ -40,7 +40,7 @@ #if defined(KEYBOARD_sofle_rev1) #define RGBLED_NUM 70 // D3 for ws2812 RGB LED - #define RGB_DI_PIN D3 + #define WS2812_DI_PIN D3 #endif #endif diff --git a/keyboards/sofle/keymaps/devdev/config.h b/keyboards/sofle/keymaps/devdev/config.h index 6564238bba..7d14c6e337 100644 --- a/keyboards/sofle/keymaps/devdev/config.h +++ b/keyboards/sofle/keymaps/devdev/config.h @@ -45,7 +45,7 @@ #define RGBLIGHT_LAYERS /* ws2812 RGB LED */ -#define RGB_DI_PIN D3 +#define WS2812_DI_PIN D3 #ifdef RGB_MATRIX_ENABLE diff --git a/keyboards/sofle/keymaps/killmaster/config.h b/keyboards/sofle/keymaps/killmaster/config.h index e4649cc5be..10c9ea450e 100644 --- a/keyboards/sofle/keymaps/killmaster/config.h +++ b/keyboards/sofle/keymaps/killmaster/config.h @@ -20,7 +20,7 @@ see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness for more options. */ -#define RGB_DI_PIN D3 +#define WS2812_DI_PIN D3 #ifdef RGB_MATRIX_ENABLE diff --git a/keyboards/sofle/keymaps/rgb_default/config.h b/keyboards/sofle/keymaps/rgb_default/config.h index 6564238bba..7d14c6e337 100644 --- a/keyboards/sofle/keymaps/rgb_default/config.h +++ b/keyboards/sofle/keymaps/rgb_default/config.h @@ -45,7 +45,7 @@ #define RGBLIGHT_LAYERS /* ws2812 RGB LED */ -#define RGB_DI_PIN D3 +#define WS2812_DI_PIN D3 #ifdef RGB_MATRIX_ENABLE diff --git a/keyboards/sofle/keymaps/via/config.h b/keyboards/sofle/keymaps/via/config.h index 2806b70b0f..d4bf95b710 100644 --- a/keyboards/sofle/keymaps/via/config.h +++ b/keyboards/sofle/keymaps/via/config.h @@ -24,7 +24,7 @@ for more options. #if defined(KEYBOARD_sofle_rev1) // Add RGB underglow and top facing lighting -# define RGB_DI_PIN D3 +# define WS2812_DI_PIN D3 # define RGBLED_NUM 70 # define RGBLED_SPLIT \ { 36, 36 } -- cgit v1.2.3 From c9f619124d41637ece157570703423c3890cb6c2 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sun, 16 Apr 2023 01:18:44 +1000 Subject: Encodermap direction define. (#20454) --- keyboards/sofle/keymaps/bastien-baloup_fr/keymap.c | 2 +- keyboards/sofle/keymaps/michal/keymap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/sofle/keymaps') diff --git a/keyboards/sofle/keymaps/bastien-baloup_fr/keymap.c b/keyboards/sofle/keymaps/bastien-baloup_fr/keymap.c index 8b97468376..ee207ae34e 100644 --- a/keyboards/sofle/keymaps/bastien-baloup_fr/keymap.c +++ b/keyboards/sofle/keymaps/bastien-baloup_fr/keymap.c @@ -166,7 +166,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) // This section is like the keymap matrix, but for rotary encoders // My left encoder is currently not working, so I'm using Layers instead -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLU, KC_VOLD)}, [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLU, KC_VOLD)}, [2] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_MNXT, KC_MPRV)}, diff --git a/keyboards/sofle/keymaps/michal/keymap.c b/keyboards/sofle/keymaps/michal/keymap.c index 49b70fd825..cbb0dc36ab 100644 --- a/keyboards/sofle/keymaps/michal/keymap.c +++ b/keyboards/sofle/keymaps/michal/keymap.c @@ -182,7 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // This section is like the keymap matrix, but for rotary encoders // My left encoder is currently not working, so I'm using Layers to cope :') -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [_WORKMAN] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLD, KC_VOLU )}, [_QWERTY] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_VOLD, KC_VOLU )}, [_LOWER] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)}, -- cgit v1.2.3 From 4ae45ca995b1f01b8e7ab3d115efe241c9adfee3 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 10 May 2023 22:55:49 +0100 Subject: Tidy up encoder_map directions (#20847) --- keyboards/sofle/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/sofle/keymaps') diff --git a/keyboards/sofle/keymaps/via/keymap.c b/keyboards/sofle/keymaps/via/keymap.c index bbb4c64826..21717a7a6c 100644 --- a/keyboards/sofle/keymaps/via/keymap.c +++ b/keyboards/sofle/keymaps/via/keymap.c @@ -19,7 +19,7 @@ #include "oled.c" #ifdef ENCODER_MAP_ENABLE -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, [1] = { ENCODER_CCW_CW(_______, _______), ENCODER_CCW_CW(_______, _______) }, [2] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) }, -- cgit v1.2.3