From b7cf9a888a607dc024d74ee72c0ebbd8e0ddfdbe Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 1 Jul 2021 00:42:32 -0700 Subject: Drashna's split updates (#13350) Co-authored-by: Ryan --- layouts/community/ergodox/drashna/keymap.c | 13 ++-- layouts/community/ergodox/drashna/visualizer.c | 77 ---------------------- layouts/community/ergodox/drashna/visualizer.c_old | 77 ++++++++++++++++++++++ layouts/community/split_3x6_3/drashna/config.h | 39 ++++++----- layouts/community/split_3x6_3/drashna/keymap.c | 2 +- 5 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 layouts/community/ergodox/drashna/visualizer.c create mode 100644 layouts/community/ergodox/drashna/visualizer.c_old (limited to 'layouts/community') diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 3e14606060..600e29020d 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -19,7 +19,7 @@ #ifdef UNICODEMAP_ENABLE # include "drashna_unicode.h" #endif // UNICODEMAP_ENABLE - +#include "drivers/sensors/pimoroni_trackball.h" enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE, PM_SCROLL, @@ -317,13 +317,14 @@ void shutdown_keymap(void) { static bool mouse_button_one, trackball_button_one; -void trackball_check_click(bool pressed, report_mouse_t* mouse) { - if (mouse_button_one | pressed) { - mouse->buttons |= MOUSE_BTN1; +void trackball_register_button(bool pressed, enum mouse_buttons button) { + report_mouse_t currentReport = pointing_device_get_report(); + if (pressed) { + currentReport.buttons |= button; } else { - mouse->buttons &= ~MOUSE_BTN1; + currentReport.buttons &= ~button; } - trackball_button_one = pressed; + pointing_device_set_report(currentReport); } #endif diff --git a/layouts/community/ergodox/drashna/visualizer.c b/layouts/community/ergodox/drashna/visualizer.c deleted file mode 100644 index 6b1c3ff498..0000000000 --- a/layouts/community/ergodox/drashna/visualizer.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2017 Fred Sundvik - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "./simple_visualizer.h" -#include "util.h" -#include "drashna.h" -#include "rgblight_list.h" - -#define LCD_COLOR_wrapper(...) LCD_COLOR(__VA_ARGS__) -// This function should be implemented by the keymap visualizer -// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing -// that the simple_visualizer assumes that you are updating -// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is -// stopped. This can be done by either double buffering it or by using constant strings -static void get_visualizer_layer_and_color(visualizer_state_t* state) { - - switch(get_highest_layer(state->status.layer|default_layer_state)) { - case _LOWER: - state->layer_text = "Lower"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_GREEN); - break; - case _RAISE: - state->layer_text = "Raise"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_YELLOW); - break; - case _ADJUST: - state->layer_text = "Adjust"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); - break; - case _MACROS: - state->layer_text = "Macros"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); - break; - case _MEDIA: - state->layer_text = "Media"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_CHARTREUSE); - break; - case _GAMEPAD: - state->layer_text = "Game"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); - break; - case _QWERTY: - state->layer_text = "QWERTY"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_CYAN); - break; - case _WORKMAN: - state->layer_text = "Workman"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_GOLDENROD); - break; - case _DVORAK: - state->layer_text = "Dvorak"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_SPRINGGREEN); - break; - case _COLEMAK: - state->layer_text = "Colemak"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_MAGENTA); - break; break; - default: - state->layer_text = "NONE"; - state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); - break; - } -} diff --git a/layouts/community/ergodox/drashna/visualizer.c_old b/layouts/community/ergodox/drashna/visualizer.c_old new file mode 100644 index 0000000000..6b1c3ff498 --- /dev/null +++ b/layouts/community/ergodox/drashna/visualizer.c_old @@ -0,0 +1,77 @@ +/* +Copyright 2017 Fred Sundvik + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "./simple_visualizer.h" +#include "util.h" +#include "drashna.h" +#include "rgblight_list.h" + +#define LCD_COLOR_wrapper(...) LCD_COLOR(__VA_ARGS__) +// This function should be implemented by the keymap visualizer +// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing +// that the simple_visualizer assumes that you are updating +// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is +// stopped. This can be done by either double buffering it or by using constant strings +static void get_visualizer_layer_and_color(visualizer_state_t* state) { + + switch(get_highest_layer(state->status.layer|default_layer_state)) { + case _LOWER: + state->layer_text = "Lower"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_GREEN); + break; + case _RAISE: + state->layer_text = "Raise"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_YELLOW); + break; + case _ADJUST: + state->layer_text = "Adjust"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); + break; + case _MACROS: + state->layer_text = "Macros"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); + break; + case _MEDIA: + state->layer_text = "Media"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_CHARTREUSE); + break; + case _GAMEPAD: + state->layer_text = "Game"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_ORANGE); + break; + case _QWERTY: + state->layer_text = "QWERTY"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_CYAN); + break; + case _WORKMAN: + state->layer_text = "Workman"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_GOLDENROD); + break; + case _DVORAK: + state->layer_text = "Dvorak"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_SPRINGGREEN); + break; + case _COLEMAK: + state->layer_text = "Colemak"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_MAGENTA); + break; break; + default: + state->layer_text = "NONE"; + state->target_lcd_color = LCD_COLOR_wrapper(HSV_RED); + break; + } +} diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h index cc53d4c367..4a094e1954 100644 --- a/layouts/community/split_3x6_3/drashna/config.h +++ b/layouts/community/split_3x6_3/drashna/config.h @@ -31,11 +31,11 @@ #ifdef RGBLIGHT_ENABLE # undef RGBLED_NUM -# define RGBLED_NUM 27 +# define RGBLED_NUM 27 -# define RGBLIGHT_HUE_STEP 8 -# define RGBLIGHT_SAT_STEP 8 -# define RGBLIGHT_VAL_STEP 5 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 5 # define RGBLIGHT_LIMIT_VAL 120 #endif @@ -44,37 +44,36 @@ # undef RGB_DI_PIN # define RGB_DI_PIN A3 # endif -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses // # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) // # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended // # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) // # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -# define RGB_MATRIX_HUE_STEP 8 -# define RGB_MATRIX_SAT_STEP 8 -# define RGB_MATRIX_VAL_STEP 5 -# define RGB_MATRIX_SPD_STEP 10 +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 5 +# define RGB_MATRIX_SPD_STEP 10 #endif #ifdef CONVERT_TO_PROTON_C -# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 -# define WS2812_PWM_CHANNEL 4 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. +# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 +# define WS2812_PWM_CHANNEL 4 // default: 2 +# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 +# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +# define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM2_UP // DMAMUX configuration for TIMx_UP -- only required if your MCU has a DMAMUX peripheral, see the respective reference manual for the appropriate values for your MCU. # undef SOFT_SERIAL_PIN -# define SOFT_SERIAL_PIN D3 -# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 -# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 +# define SOFT_SERIAL_PIN D3 +# define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1 +# define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 // #define INIT_EE_HANDS_LEFT // #define INIT_EE_HANDS_RIGHT #endif - #if defined(AUDIO_ENABLE) && !defined(CONVERT_TO_PROTON_C) # define AUDIO_PIN B6 # define NO_MUSIC_MODE diff --git a/layouts/community/split_3x6_3/drashna/keymap.c b/layouts/community/split_3x6_3/drashna/keymap.c index 5a2d2f2e27..e46b626ef9 100644 --- a/layouts/community/split_3x6_3/drashna/keymap.c +++ b/layouts/community/split_3x6_3/drashna/keymap.c @@ -114,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // clang-format on #ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { +oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return OLED_ROTATION_270; } #endif -- cgit v1.2.3