forked from mfulz_github/qmk_firmware
		
	Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
		
						commit
						e8c46fab96
					
				| @ -18,10 +18,10 @@ | ||||
| 
 | ||||
| #undef MATRIX_COL_PINS | ||||
| #define MATRIX_COL_PINS \ | ||||
|     { B0, B1, B10, B3, B4, B5 } | ||||
|     { B0, B1, B12, B3, B4, B5 } | ||||
| #undef MATRIX_COL_PINS_RIGHT | ||||
| #define MATRIX_COL_PINS_RIGHT \ | ||||
|     { B0, B1, B10, B3, B4, B5 } | ||||
|     { B0, B1, B12, B3, B4, B5 } | ||||
| 
 | ||||
| #undef MATRIX_ROW_PINS | ||||
| #define MATRIX_ROW_PINS \ | ||||
| @ -30,8 +30,12 @@ | ||||
| #define MATRIX_ROW_PINS_RIGHT \ | ||||
|     { B15, A2, B8, A8, B9 } | ||||
| 
 | ||||
| #define UNUSED_PINS { B6, C14, C15 } | ||||
| 
 | ||||
| #define DIODE_DIRECTION ROW2COL | ||||
| #define SPLIT_HAND_PIN A3 | ||||
| #undef MASTER_RIGHT | ||||
| // #define USB_VBUS_PIN B10
 | ||||
| 
 | ||||
| #undef RGB_DI_PIN | ||||
| #define RGB_DI_PIN A1 | ||||
| @ -46,6 +50,13 @@ | ||||
| 
 | ||||
| #define DEBUG_LED_PIN     C13 | ||||
| 
 | ||||
| #define AUDIO_PIN          B7 | ||||
| #define AUDIO_PWM_DRIVER   PWMD4 | ||||
| #define AUDIO_PWM_CHANNEL  2 | ||||
| #define AUDIO_PWM_PAL_MODE 2 | ||||
| #define AUDIO_STATE_TIMER  GPTD3 | ||||
| #define AUDIO_INIT_DELAY | ||||
| 
 | ||||
| #undef SOFT_SERIAL_PIN | ||||
| // #define SERIAL_USART_FULL_DUPLEX  // Enable full duplex operation mode.
 | ||||
| #define SERIAL_USART_TX_PIN      A9 | ||||
| @ -77,9 +88,12 @@ | ||||
| #define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR    64 | ||||
| 
 | ||||
| #undef PMW3360_CS_PIN | ||||
| #define PMW3360_CS_PIN                       B14 | ||||
| #define PMW3360_CS_PIN                       A15  // b14
 | ||||
| #define PMW3360_CS_MODE 3 | ||||
| #define PMW3360_CS_DIVISOR 64 | ||||
| #define PMW3360_LIFTOFF_DISTANCE 0b1111 | ||||
| #undef ROTATIONAL_TRANSFORM_ANGLE | ||||
| #define ROTATIONAL_TRANSFORM_ANGLE -65 | ||||
| 
 | ||||
| #define CHARYBDIS_MINIMUM_DEFAULT_DPI     1200 | ||||
| #define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 400 | ||||
| @ -90,3 +104,5 @@ | ||||
| 
 | ||||
| #undef RGB_MATRIX_MAXIMUM_BRIGHTNESS | ||||
| #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 | ||||
| 
 | ||||
| #define CHARYBDIS_CONFIG_SYNC | ||||
|  | ||||
| @ -16,11 +16,12 @@ | ||||
| #pragma once | ||||
| 
 | ||||
| #define HAL_USE_PWM     TRUE | ||||
| #define HAL_USE_PAL     TRUE | ||||
| #define HAL_USE_GPT     TRUE | ||||
| #define HAL_USE_SERIAL  TRUE | ||||
| // #define HAL_USE_I2C     TRUE
 | ||||
| #define HAL_USE_SPI     TRUE | ||||
| #define SPI_USE_WAIT    TRUE | ||||
| #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||||
| // #define HAL_USE_GPT     TRUE
 | ||||
| 
 | ||||
| #include_next <halconf.h> | ||||
|  | ||||
| @ -26,8 +26,8 @@ | ||||
|      KC_ESC,  ________________NUMBER_LEFT________________,            ________________NUMBER_RIGHT_______________, UC_CLUE, \ | ||||
|      SH_TT,   K01,    K02,      K03,     K04,     K05,                K06,     K07,     K08,     K09,     K0A,     SH_TT, \ | ||||
|      LALT_T(KC_TAB), K11, K12,  K13,     K14,     K15,                K16,     K17,     K18,     K19,     K1A,     RALT_T(K1B), \ | ||||
|      OS_LSFT, CTL_T(K21), K22,  K23,     K24,     K25,                K26,     K27,     K28,     K29, RCTL_T(K2A), OS_RSFT, \ | ||||
|                                    KC_GRV, OS_LALT, OS_LGUI,    TT(_MOUSE),  KC_ENT, \ | ||||
|      OS_LSFT,CTL_T(K21),ALT_T(K22),GUI_T(K23),K24,K25,                K26,K27,RGUI_T(K28),RALT_T(K29),RCTL_T(K2A), OS_RSFT, \ | ||||
|                            SFT_T(KC_GRV), UC_IRNY, OS_LGUI,    TT(_MOUSE),  KC_ENT, \ | ||||
|                                            KC_SPC, BK_LWER,     DL_RAIS \ | ||||
|     ) | ||||
| 
 | ||||
| @ -58,38 +58,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||||
|         _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ | ||||
|     ), | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     [_MOUSE] = LAYOUT_charybdis_4x6( | ||||
|         _______, _______, _______, _______, _______, _______,   DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_WH_U, _______, _______, _______, _______, _______, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, | ||||
|                                    _______, _______, _______,    _______, _______, | ||||
|                                            _______, _______,      _______ | ||||
|     ), | ||||
|     [_GAMEPAD] = LAYOUT_charybdis_4x6( | ||||
|         KC_ESC,  KC_NO,   KC_1,    KC_2,    KC_3,    KC_4,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_F1,   KC_K,    KC_Q,    KC_W,    KC_E,    KC_R,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_TAB,  KC_G,    KC_A,    KC_S,    KC_D,    KC_F,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_LCTL, KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_H,       _______, _______, _______, _______, _______, _______, | ||||
|                                    _______, _______, _______,    _______, _______, | ||||
|                                            _______, _______,      _______ | ||||
|                                    KC_V,    _______, _______,    _______, TG_GAME, | ||||
|                                            KC_SPC, KC_H,          _______ | ||||
|     ), | ||||
|     [_DIABLO] = LAYOUT_charybdis_4x6( | ||||
|         KC_ESC,  KC_V,    KC_D,    KC_LALT, KC_NO,   KC_NO,      KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NO,   KC_NO, | ||||
|         KC_TAB,  KC_S,    KC_I,    KC_F,    KC_M,    KC_T,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_Q,    KC_1,    KC_2,    KC_3,    KC_4,    KC_G,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z,       _______, _______, _______, _______, _______, _______, | ||||
|                                    _______, _______, _______,    _______, _______, | ||||
|                                            _______, _______,      _______ | ||||
|                                    KC_G,    _______, _______,    TO(_DIABLOII), TG_DBLO, | ||||
|                                            KC_LSFT, KC_LCTL,      _______ | ||||
|     ), | ||||
|     [_DIABLOII] = LAYOUT_charybdis_4x6( | ||||
|         KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_GRV,     _______, _______, _______, _______, _______, _______, | ||||
|         KC_TAB,  KC_A,    KC_T,    KC_Q,    KC_I,    KC_M,       _______, _______, _______, _______, _______, _______, | ||||
|         KC_S,    KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,      _______, _______, _______, _______, _______, _______, | ||||
|         KC_LCTL, KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,     _______, _______, _______, _______, _______, _______, | ||||
|                                    _______, _______, _______,    _______, _______, | ||||
|                            KC_DIABLO_CLEAR, _______, _______,    _______, TG(_DIABLOII), | ||||
|                                SFT_T(KC_SPACE),  ALT_T(KC_Q),      _______ | ||||
|     ), | ||||
|     [_MOUSE] = LAYOUT_charybdis_4x6( | ||||
|         _______, _______, _______, _______, _______, _______,   _______, _______, _______, _______, _______, _______, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_WH_U, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, _______, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | ||||
|         _______, _______, _______, _______, _______, _______,   KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, DRGSCRL, _______, | ||||
|                                    _______, SNIPING, SNIPING,    _______, _______, | ||||
|                                            _______, _______,      _______ | ||||
|     ), | ||||
| 
 | ||||
| @ -112,18 +110,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||||
|     ), | ||||
| 
 | ||||
|     [_ADJUST] = LAYOUT_charybdis_4x6_wrapper( | ||||
|         QK_MAKE, KC_WIDE,KC_AUSSIE,KC_SCRIPT,KC_ZALGO,KC_NOMODE, KC_NOMODE,KC_BLOCKS,KC_REGIONAL,_______,_______, QK_BOOT, | ||||
|         QK_MAKE, KC_WIDE,KC_AUSSIE,KC_SCRIPT,KC_ZALGO,KC_SUPER, KC_NOMODE,KC_BLOCKS,KC_REGIONAL,TG_GAME,TG_DBLO, QK_BOOT, | ||||
|         VRSN,    _________________ADJUST_L1_________________,    _________________ADJUST_R1_________________, EE_CLR, | ||||
|         KEYLOCK, _________________ADJUST_L2_________________,    _________________ADJUST_R2_________________, TG_MODS, | ||||
|         UC_MOD,  _________________ADJUST_L3_________________,    _________________ADJUST_R3_________________, KC_MPLY, | ||||
|                                    QK_RBT, AUTO_CTN, _______,    KC_NUKE, _______, | ||||
|                                    QK_RBT, AUTO_CTN, _______,    _______, KC_NUKE, | ||||
|                                            _______, _______,      _______ | ||||
|     ) | ||||
| }; | ||||
| // clang-format on
 | ||||
| 
 | ||||
| 
 | ||||
| void matrix_init_keyemap(void) { setPinInputHigh(A0); } | ||||
| void matrix_init_keymap(void) { | ||||
|     setPinInputHigh(A0); | ||||
| #ifdef RGB_MATRIX_ENABLE | ||||
|      g_led_config.flags[53] = g_led_config.flags[54] = g_led_config.flags[55] = | ||||
|         g_led_config.flags[0] = g_led_config.flags[1] = g_led_config.flags[2] = g_led_config.flags[3] = | ||||
|         g_led_config.flags[29] = g_led_config.flags[30] = g_led_config.flags[31] = g_led_config.flags[32] = | ||||
|         LED_FLAG_MODIFIER; | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| void matrix_scan_keymap(void) { | ||||
|     if (!readPin(A0)) { | ||||
| @ -144,3 +150,25 @@ void matrix_output_unselect_delay(uint8_t line, bool key_pressed) { | ||||
|         __asm__ volatile("nop" ::: "memory"); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| #ifdef SWAP_HANDS_ENABLE | ||||
| const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { | ||||
|     /* Left hand, matrix positions */ | ||||
|     {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}}, | ||||
|     {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}, | ||||
|     {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}}, | ||||
|     {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}}, | ||||
|     {{2, 9}, {4, 9}, {5, 9}, {1, 9}, {0, 9}, {3, 9}}, | ||||
|     /* Right hand, matrix positions */ | ||||
|     {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, | ||||
|     {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, | ||||
|     {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, | ||||
|     {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, | ||||
|     {{0, 4}, {3, 4}, {2, 4}, {5, 4}, {4, 4}, {2, 4}}, | ||||
|     }; | ||||
| 
 | ||||
| #    ifdef ENCODER_MAP_ENABLE | ||||
| const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0}; | ||||
| #    endif | ||||
| #endif | ||||
|  | ||||
| @ -17,19 +17,18 @@ | ||||
| #pragma once | ||||
| 
 | ||||
| #include_next "mcuconf.h" | ||||
| #undef STM32_I2C_USE_I2C1 | ||||
| #define STM32_I2C_USE_I2C1 TRUE | ||||
| 
 | ||||
| // #undef STM32_I2C_I2C1_RX_DMA_STREAM
 | ||||
| // #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
 | ||||
| #undef STM32_I2C_I2C1_TX_DMA_STREAM | ||||
| #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) | ||||
| #undef STM32_PWM_USE_ADVANCED | ||||
| #define STM32_PWM_USE_ADVANCED TRUE | ||||
| 
 | ||||
| #undef STM32_PWM_USE_TIM1 | ||||
| #define STM32_PWM_USE_TIM1 TRUE | ||||
| 
 | ||||
| #undef STM32_PWM_USE_TIM2 | ||||
| #define STM32_PWM_USE_TIM2 TRUE | ||||
| 
 | ||||
| #undef STM32_PWM_USE_TIM3 | ||||
| #define STM32_PWM_USE_TIM3 TRUE | ||||
| #undef STM32_PWM_USE_TIM4 | ||||
| #define STM32_PWM_USE_TIM4 TRUE | ||||
| 
 | ||||
| #undef STM32_SPI_USE_SPI1 | ||||
| #define STM32_SPI_USE_SPI1 TRUE | ||||
| @ -37,8 +36,8 @@ | ||||
| #undef STM32_SERIAL_USE_USART1 | ||||
| #define STM32_SERIAL_USE_USART1 TRUE | ||||
| 
 | ||||
| #undef STM32_GPT_USE_TIM4 | ||||
| #define STM32_GPT_USE_TIM4 TRUE | ||||
| #undef STM32_GPT_USE_TIM3 | ||||
| #define STM32_GPT_USE_TIM3 TRUE | ||||
| 
 | ||||
| #undef STM32_ST_USE_TIMER | ||||
| #define STM32_ST_USE_TIMER 5 | ||||
|  | ||||
| @ -1,24 +1,33 @@ | ||||
| # MCU name
 | ||||
| MCU = STM32F411 | ||||
| BOARD = BLACKPILL_STM32_F411 | ||||
| 
 | ||||
| # Bootloader selection
 | ||||
| BOOTLOADER = stm32-dfu | ||||
| # BOOTLOADER := tinyuf2
 | ||||
| 
 | ||||
| LTO_ENABLE := no | ||||
| BOOTLOADER := tinyuf2 | ||||
| 
 | ||||
| BOOTMAGIC_ENABLE      = yes # Enable Bootmagic Lite | ||||
| MOUSEKEY_ENABLE       = yes # Mouse keys | ||||
| EXTRAKEY_ENABLE       = yes # Audio control and System control | ||||
| CONSOLE_ENABLE        = yes # Console for debug | ||||
| COMMAND_ENABLE        = no  # Commands for debug and configuration | ||||
| NKRO_ENABLE           = yes # Enable N-Key Rollover | ||||
| RGBLIGHT_ENABLE       = no  # Enable keyboard RGB underglow | ||||
| AUDIO_ENABLE          = yes # Audio output | ||||
| AUDIO_SUPPORTED       = yes # is set to no in kb, needs to be forcibly enabled | ||||
| 
 | ||||
| KEYBOARD_SHARED_EP    = yes | ||||
| MOUSE_SHARED_EP       = yes | ||||
| 
 | ||||
| EEPROM_DRIVER         = spi | ||||
| WS2812_DRIVER         = pwm | ||||
| SERIAL_DRIVER         = usart | ||||
| 
 | ||||
| MOUSEKEY_ENABLE = yes | ||||
| NKRO_ENABLE = yes | ||||
| CONSOLE_ENABLE = yes | ||||
| AUDIO_DRIVER          = pwm_hardware | ||||
| BACKLIGHT_DRIVER      = pwm | ||||
| 
 | ||||
| AUTOCORRECTION_ENABLE = yes | ||||
| 
 | ||||
| CAPS_WORD_ENABLE      = yes | ||||
| SWAP_HANDS_ENABLE     = yes | ||||
| TAP_DANCE_ENABLE      = yes | ||||
| DEBOUNCE_TYPE         = asym_eager_defer_pk | ||||
| WPM_ENABLE            = yes | ||||
| LTO_ENABLE            = no | ||||
|  | ||||
| @ -28,8 +28,3 @@ | ||||
| #define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 200 | ||||
| 
 | ||||
| #define ENCODER_DEFAULT_POS 0x3 | ||||
| 
 | ||||
| #define SECURE_UNLOCK_SEQUENCE \ | ||||
|     {                          \ | ||||
|         { 2, 1 }, { 2, 2 }, { 2, 3 }, { 2, 4 } \ | ||||
|     } | ||||
|  | ||||
| @ -59,16 +59,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||||
|         _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ | ||||
|     ), | ||||
| 
 | ||||
|     [_MOUSE] = LAYOUT_5x6_right( | ||||
|         _______, _______, _______, _______, _______, _______,                        DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_WH_U, _______, _______, _______, _______, _______, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, | ||||
|                           _______, _______,                                                            _______, _______, | ||||
|                                             _______, _______,                                 KC_BTN3, | ||||
|                                                      _______, _______,               _______, | ||||
|                                                      _______, _______,      _______, _______ | ||||
|     ), | ||||
|     [_GAMEPAD] = LAYOUT_5x6_right( | ||||
|         KC_ESC,  KC_NO,   KC_1,    KC_2,    KC_3,    KC_4,                           _______, _______, _______, _______, _______, _______, | ||||
|         KC_F1,   KC_K,    KC_Q,    KC_W,    KC_E,    KC_R,                           _______, _______, _______, _______, _______, _______, | ||||
| @ -99,6 +89,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||||
|                                                KC_LSFT, _______,                     _______, | ||||
|                                                KC_LCTL, KC_V,               _______, _______ | ||||
|     ), | ||||
|     [_MOUSE] = LAYOUT_5x6_right( | ||||
|         _______, _______, _______, _______, _______, _______,                        DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_WH_U, _______, _______, _______, _______, _______, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING, | ||||
|         _______, _______, _______, _______, _______, _______,                        KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______, | ||||
|                           _______, _______,                                                            _______, _______, | ||||
|                                             _______, _______,                                 KC_BTN3, | ||||
|                                                      _______, _______,               _______, | ||||
|                                                      _______, _______,      _______, _______ | ||||
|     ), | ||||
|     [_LOWER] = LAYOUT_5x6_right_wrapper( | ||||
|         KC_F12,  _________________FUNC_LEFT_________________,                        _________________FUNC_RIGHT________________, KC_F11, | ||||
|         _______, _________________LOWER_L1__________________,                        _________________LOWER_R1__________________, _______, | ||||
|  | ||||
| @ -124,7 +124,9 @@ float doom_song[][2] = SONG(E1M1_DOOM); | ||||
| 
 | ||||
| // on layer change, no matter where the change was initiated
 | ||||
| // Then runs keymap's layer change check
 | ||||
| __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } | ||||
| __attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { | ||||
|     return state; | ||||
| } | ||||
| layer_state_t layer_state_set_user(layer_state_t state) { | ||||
|     if (!is_keyboard_master()) { | ||||
|         return state; | ||||
| @ -153,28 +155,31 @@ layer_state_t                       layer_state_set_user(layer_state_t state) { | ||||
| } | ||||
| 
 | ||||
| // Runs state check and changes underglow color and animation
 | ||||
| __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } | ||||
| __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { | ||||
|     return state; | ||||
| } | ||||
| layer_state_t default_layer_state_set_user(layer_state_t state) { | ||||
|     if (!is_keyboard_master()) { | ||||
|         return state; | ||||
|     } | ||||
| 
 | ||||
|     state = default_layer_state_set_keymap(state); | ||||
| #if 0 | ||||
| #    if defined(CUSTOM_RGBLIGHT) || defined(RGB_MATRIX_ENABLE) | ||||
|   state = default_layer_state_set_rgb(state); | ||||
| #    endif | ||||
| #if defined(CUSTOM_RGBLIGHT) | ||||
|     state = default_layer_state_set_rgb_light(state); | ||||
| #endif | ||||
|     return state; | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} | ||||
| void                       led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } | ||||
| void                       led_set_user(uint8_t usb_led) { | ||||
|     led_set_keymap(usb_led); | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) void eeconfig_init_keymap(void) {} | ||||
| void                       eeconfig_init_user(void) { | ||||
|     userspace_config.raw              = 0; | ||||
|     userspace_config.rgb_layer_change = true; | ||||
|     userspace_config.autocorrection   = true; | ||||
|     eeconfig_update_user(userspace_config.raw); | ||||
|     eeconfig_init_keymap(); | ||||
| } | ||||
| @ -214,3 +219,11 @@ void                       matrix_slave_scan_user(void) { | ||||
|     matrix_slave_scan_keymap(); | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| __attribute__((weak)) void housekeeping_task_keymap(void) {} | ||||
| void housekeeping_task_user(void) { | ||||
| #if defined(SPLIT_KEYBOARD) && defined(SPLIT_TRANSACTION_IDS_USER) | ||||
|     housekeeping_task_transport_sync(); | ||||
| #endif | ||||
|     housekeeping_task_keymap(); | ||||
| } | ||||
|  | ||||
| @ -16,6 +16,7 @@ layer_state_t layer_state_set_keymap(layer_state_t state); | ||||
| layer_state_t default_layer_state_set_keymap(layer_state_t state); | ||||
| void          led_set_keymap(uint8_t usb_led); | ||||
| void          eeconfig_init_keymap(void); | ||||
| void          housekeeping_task_keymap(void); | ||||
| 
 | ||||
| #ifdef CUSTOM_UNICODE_ENABLE | ||||
| void matrix_init_unicode(void); | ||||
|  | ||||
| @ -183,11 +183,17 @@ | ||||
| #endif     // RGB_MATRIX_ENABLE
 | ||||
| 
 | ||||
| #ifdef OLED_ENABLE | ||||
| #    ifndef OLED_UPDATE_INTERVAL | ||||
| #        ifdef OLED_DRIVER_SH1107 | ||||
| #            define OLED_UPDATE_INTERVAL 75 | ||||
| #        else | ||||
| #            ifdef SPLIT_KEYBOARD | ||||
| #                define OLED_UPDATE_INTERVAL 60 | ||||
| #            else | ||||
| #                define OLED_UPDATE_INTERVAL 15 | ||||
| #            endif | ||||
| #        endif | ||||
| #    endif | ||||
| #    define OLED_DISABLE_TIMEOUT | ||||
| #    ifdef OLED_FONT_H | ||||
| #        undef OLED_FONT_H | ||||
| @ -223,7 +229,6 @@ | ||||
| // #define WPM_SAMPLE_PERIODS 50
 | ||||
| // #define WPM_LAUNCH_CONTROL
 | ||||
| 
 | ||||
| 
 | ||||
| #ifndef ONESHOT_TAP_TOGGLE | ||||
| #    define ONESHOT_TAP_TOGGLE 2 | ||||
| #endif // !ONESHOT_TAP_TOGGLE
 | ||||
| @ -238,7 +243,6 @@ | ||||
| #define RETRO_TAPPING_PER_KEY | ||||
| #define TAPPING_TERM_PER_KEY | ||||
| 
 | ||||
| 
 | ||||
| #ifndef TAPPING_TOGGLE | ||||
| #    define TAPPING_TOGGLE 1 | ||||
| #endif | ||||
| @ -291,12 +295,22 @@ | ||||
| #    ifndef OLED_BRIGHTNESS | ||||
| #        define OLED_BRIGHTNESS 50 | ||||
| #    endif | ||||
| #    if !defined(STM32F4XX) | ||||
| #        undef OLED_UPDATE_INTERVAL | ||||
| #        define OLED_UPDATE_INTERVAL 75 | ||||
| #endif | ||||
| 
 | ||||
| #ifdef USE_I2CV1 | ||||
| #    define I2C1_CLOCK_SPEED 400000 | ||||
| #    define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 | ||||
| #endif | ||||
| 
 | ||||
| #define ENABLE_COMPILE_KEYCODE | ||||
| 
 | ||||
| #define BOTH_SHIFTS_TURNS_ON_CAPS_WORD | ||||
| 
 | ||||
| #ifndef SECURE_UNLOCK_SEQUENCE | ||||
| #    define SECURE_UNLOCK_SEQUENCE    \ | ||||
|         {                             \ | ||||
|             {2, 1}, {2, 2}, {2, 3}, { \ | ||||
|                 2, 4                  \ | ||||
|             }                         \ | ||||
|         } | ||||
| #endif | ||||
|  | ||||
| @ -20,8 +20,12 @@ bool     host_driver_disabled = false; | ||||
|  * | ||||
|  * This handles the keycodes at the keymap level, useful for keyboard specific customization | ||||
|  */ | ||||
| __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } | ||||
| __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } | ||||
| __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||||
|     return true; | ||||
| } | ||||
| __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| /**
 | ||||
|  * @brief Main user keycode handler | ||||
| @ -205,4 +209,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) void post_process_record_keymap(uint16_t keycode, keyrecord_t *record) {} | ||||
| void                       post_process_record_user(uint16_t keycode, keyrecord_t *record) { post_process_record_keymap(keycode, record); } | ||||
| void                       post_process_record_user(uint16_t keycode, keyrecord_t *record) { | ||||
|     post_process_record_keymap(keycode, record); | ||||
| } | ||||
|  | ||||
| @ -44,6 +44,7 @@ enum userspace_custom_keycodes { | ||||
|     KC_REGIONAL, | ||||
|     KC_AUSSIE, | ||||
|     KC_ZALGO, | ||||
|     KC_SUPER, | ||||
|     KC_ACCEL, | ||||
|     AUTOCORRECT_ON, | ||||
|     AUTOCORRECT_OFF, | ||||
|  | ||||
| @ -29,10 +29,10 @@ __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyreco | ||||
|     // Do not select the hold action when another key is pressed.
 | ||||
|     // return false;
 | ||||
|     switch (keycode) { | ||||
|         case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: | ||||
|             return true; | ||||
| //        case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
 | ||||
| //            return true;
 | ||||
|         default: | ||||
|             return false; | ||||
|             return true; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -130,6 +130,45 @@ DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_aussie, | ||||
|                               '0'     // 0
 | ||||
| ); | ||||
| 
 | ||||
| DEFINE_UNICODE_LUT_TRANSLATOR(unicode_lut_translator_super, | ||||
|                               0x1D43, // a
 | ||||
|                               0x1D47, // b
 | ||||
|                               0x1D9C, // c
 | ||||
|                               0x1D48, // d
 | ||||
|                               0x1D49, // e
 | ||||
|                               0x1DA0, // f
 | ||||
|                               0x1D4D, // g
 | ||||
|                               0x02B0, // h
 | ||||
|                               0x2071, // i
 | ||||
|                               0x02B2, // j
 | ||||
|                               0x1D4F, // k
 | ||||
|                               0x1D4F, // l
 | ||||
|                               0x1D50, // m
 | ||||
|                               0x207F, // n
 | ||||
|                               0x1D52, // o
 | ||||
|                               0x1D56, // p
 | ||||
|                               0x06F9, // q
 | ||||
|                               0x02B3, // r
 | ||||
|                               0x02E2, // s
 | ||||
|                               0x1D57, // t
 | ||||
|                               0x1D58, // u
 | ||||
|                               0x1D5B, // v
 | ||||
|                               0x02B7, // w
 | ||||
|                               0x02E3, // x
 | ||||
|                               0x02B8, // y
 | ||||
|                               0x1DBB, // z
 | ||||
|                               0x00B9, // 1
 | ||||
|                               0x00B2, // 2
 | ||||
|                               0x00B3, // 3
 | ||||
|                               0x2074, // 4
 | ||||
|                               0x2075, // 5
 | ||||
|                               0x2076, // 6
 | ||||
|                               0x2077, // 7
 | ||||
|                               0x2078, // 8
 | ||||
|                               0x2079, // 9
 | ||||
|                               0x2070  // 0
 | ||||
| ); | ||||
| 
 | ||||
| bool process_record_aussie(uint16_t keycode, keyrecord_t *record) { | ||||
|     bool is_shifted = (get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT; | ||||
|     if ((KC_A <= keycode) && (keycode <= KC_0)) { | ||||
| @ -241,7 +280,7 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { | ||||
|                 register_unicode(0x203D); | ||||
|             } | ||||
|             break; | ||||
|         case KC_NOMODE ... KC_ZALGO: | ||||
|         case KC_NOMODE ... KC_SUPER: | ||||
|             if (record->event.pressed) { | ||||
|                 if (typing_mode != keycode - KC_NOMODE) { | ||||
|                     typing_mode = keycode - KC_NOMODE; | ||||
| @ -280,6 +319,10 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { | ||||
|                 return false; | ||||
|             } | ||||
|         } | ||||
|     } else if (typing_mode == UCTM_SUPER) { | ||||
|         if (((KC_A <= keycode) && (keycode <= KC_0))) { | ||||
|             return process_record_glyph_replacement(keycode, record, unicode_lut_translator_super); | ||||
|         } | ||||
|     } else if (typing_mode == UCTM_AUSSIE) { | ||||
|         return process_record_aussie(keycode, record); | ||||
|     } else if (typing_mode == UCTM_ZALGO) { | ||||
| @ -292,4 +335,6 @@ bool process_record_unicode(uint16_t keycode, keyrecord_t *record) { | ||||
|  * @brief Initialize the default unicode mode on firmware startu | ||||
|  * | ||||
|  */ | ||||
| void matrix_init_unicode(void) { unicode_input_mode_init(); } | ||||
| void matrix_init_unicode(void) { | ||||
|     unicode_input_mode_init(); | ||||
| } | ||||
|  | ||||
| @ -11,6 +11,7 @@ enum unicode_typing_mode { | ||||
|     UCTM_REGIONAL, | ||||
|     UCTM_AUSSIE, | ||||
|     UCTM_ZALGO, | ||||
|     UCTM_SUPER, | ||||
| }; | ||||
| 
 | ||||
| extern uint8_t typing_mode; | ||||
|  | ||||
| @ -34,7 +34,7 @@ uint32_t        oled_timer                        = 0; | ||||
| char            keylog_str[OLED_KEYLOGGER_LENGTH] = {0}; | ||||
| static uint16_t log_timer                         = 0; | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
| static const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; | ||||
| const char PROGMEM display_border[3] = {0x0, 0xFF, 0x0}; | ||||
| #endif | ||||
| 
 | ||||
| deferred_token kittoken; | ||||
| @ -117,9 +117,9 @@ void oled_timer_reset(void) { | ||||
|  * @brief Renders keylogger buffer to oled | ||||
|  * | ||||
|  */ | ||||
| void render_keylogger_status(void) { | ||||
| void render_keylogger_status(uint8_t col, uint8_t line) { | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
|     oled_set_cursor(1, 6); | ||||
|     oled_set_cursor(col, line); | ||||
| #endif | ||||
|     oled_write_P(PSTR(OLED_RENDER_KEYLOGGER), false); | ||||
|     oled_write(keylog_str, false); | ||||
| @ -132,9 +132,9 @@ void render_keylogger_status(void) { | ||||
|  * @brief Renders default layer state (aka layout) to oled | ||||
|  * | ||||
|  */ | ||||
| void render_default_layer_state(void) { | ||||
| void render_default_layer_state(uint8_t col, uint8_t line) { | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
|     oled_set_cursor(1, 1); | ||||
|     oled_set_cursor(col, line); | ||||
| #endif | ||||
|     oled_write_P(PSTR(OLED_RENDER_LAYOUT_NAME), false); | ||||
|     switch (get_highest_layer(default_layer_state)) { | ||||
| @ -160,7 +160,7 @@ void render_default_layer_state(void) { | ||||
|  * @brief Renders the active layers to the OLED | ||||
|  * | ||||
|  */ | ||||
| void render_layer_state(void) { | ||||
| void render_layer_state(uint8_t col, uint8_t line) { | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
|     // clang-format off
 | ||||
|     static const char PROGMEM tri_layer_image[][3][24] = { | ||||
| @ -286,33 +286,33 @@ void render_layer_state(void) { | ||||
|         layer_is[2] = 5; | ||||
|     } | ||||
| 
 | ||||
|     oled_set_cursor(1, 2); | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[0]][0], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(5, 2); | ||||
|     oled_set_cursor(col + 4, line); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[1]][0], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(9, 2); | ||||
|     oled_set_cursor(col + 8, line); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[2]][0], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(14, 2); | ||||
|     oled_set_cursor(col + 13, line); | ||||
|     oled_write_P(PSTR("Diablo2"), layer_state_is(_DIABLOII)); | ||||
|     oled_advance_page(true); | ||||
| 
 | ||||
|     oled_set_cursor(1, 3); | ||||
|     oled_set_cursor(col, line + 1); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[0]][1], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(5, 3); | ||||
|     oled_set_cursor(col + 4, line + 1); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[1]][1], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(9, 3); | ||||
|     oled_set_cursor(col + 8, line + 1); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[2]][1], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(14, 3); | ||||
|     oled_set_cursor(col + 13, line + 1); | ||||
|     oled_write_P(PSTR("Diablo3"), layer_state_is(_DIABLO)); | ||||
|     oled_advance_page(true); | ||||
| 
 | ||||
|     oled_set_cursor(1, 4); | ||||
|     oled_set_cursor(col, line + 2); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[0]][2], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(5, 4); | ||||
|     oled_set_cursor(col + 4, line + 2); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[1]][2], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(9, 4); | ||||
|     oled_set_cursor(col + 8, line + 2); | ||||
|     oled_write_raw_P(tri_layer_image[layer_is[2]][2], sizeof(tri_layer_image[0][0])); | ||||
|     oled_set_cursor(14, 4); | ||||
|     oled_set_cursor(col + 13, line + 2); | ||||
|     oled_write_P(PSTR("Media"), layer_state_is(_MEDIA)); | ||||
| #else | ||||
|     oled_write_P(PSTR(OLED_RENDER_LAYER_NAME), false); | ||||
| @ -327,9 +327,12 @@ void render_layer_state(void) { | ||||
|  * | ||||
|  * @param led_usb_state Current keyboard led state | ||||
|  */ | ||||
| void render_keylock_status(led_t led_usb_state) { | ||||
| void render_keylock_status(led_t led_usb_state, uint8_t col, uint8_t line) { | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     oled_set_cursor(1, 6); | ||||
|     oled_set_cursor(col, line); | ||||
| #endif | ||||
| #ifdef CAPS_WORD_ENABLE | ||||
|     led_usb_state.caps_lock |= is_caps_word_on(); | ||||
| #endif | ||||
|     oled_write_P(PSTR(OLED_RENDER_LOCK_NAME), false); | ||||
| #if !defined(OLED_DISPLAY_VERBOSE) | ||||
| @ -348,8 +351,9 @@ void render_keylock_status(led_t led_usb_state) { | ||||
|  * @brief Renders the matrix scan rate to the host system | ||||
|  * | ||||
|  */ | ||||
| void render_matrix_scan_rate(uint8_t padding) { | ||||
| void render_matrix_scan_rate(uint8_t padding, uint8_t col, uint8_t line) { | ||||
| #ifdef DEBUG_MATRIX_SCAN_RATE | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_P(PSTR("MS:"), false); | ||||
|     if (padding) { | ||||
|         for (uint8_t n = padding; n > 0; n--) { | ||||
| @ -365,10 +369,10 @@ void render_matrix_scan_rate(uint8_t padding) { | ||||
|  * | ||||
|  * @param modifiers Modifiers to check against (real, weak, onesheot, etc;) | ||||
|  */ | ||||
| void render_mod_status(uint8_t modifiers) { | ||||
| void render_mod_status(uint8_t modifiers, uint8_t col, uint8_t line) { | ||||
|     static const char PROGMEM mod_status[5][3] = {{0xE8, 0xE9, 0}, {0xE4, 0xE5, 0}, {0xE6, 0xE7, 0}, {0xEA, 0xEB, 0}, {0xEC, 0xED, 0}}; | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     oled_set_cursor(1, 5); | ||||
|     oled_set_cursor(col, line); | ||||
| #endif | ||||
|     oled_write_P(PSTR(OLED_RENDER_MODS_NAME), false); | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
| @ -393,7 +397,7 @@ void render_mod_status(uint8_t modifiers) { | ||||
| extern bool swap_hands; | ||||
| #endif | ||||
| 
 | ||||
| void render_bootmagic_status(void) { | ||||
| void render_bootmagic_status(uint8_t col, uint8_t line) { | ||||
|     /* Show Ctrl-Gui Swap options */ | ||||
|     static const char PROGMEM logo[][2][3] = { | ||||
|         {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, | ||||
| @ -402,7 +406,8 @@ void render_bootmagic_status(void) { | ||||
| 
 | ||||
|     bool is_bootmagic_on; | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
|     oled_set_cursor(7, 3); | ||||
|     oled_set_cursor(col, line); | ||||
|     //    oled_set_cursor(7, 3);
 | ||||
|     is_bootmagic_on = !keymap_config.swap_lctl_lgui; | ||||
| #else | ||||
|     is_bootmagic_on = keymap_config.swap_lctl_lgui; | ||||
| @ -435,7 +440,7 @@ void render_bootmagic_status(void) { | ||||
|     oled_write_P(PSTR(OLED_RENDER_BOOTMAGIC_NOGUI), keymap_config.no_gui); | ||||
| #endif | ||||
| #ifdef OLED_DISPLAY_VERBOSE | ||||
|     oled_set_cursor(7, 4); | ||||
|     oled_set_cursor(col, line + 1); | ||||
|     if (keymap_config.swap_lctl_lgui) { | ||||
|         oled_write_P(logo[1][1], is_bootmagic_on); | ||||
|     } else { | ||||
| @ -455,7 +460,7 @@ void render_bootmagic_status(void) { | ||||
| extern bool tap_toggling; | ||||
| #endif | ||||
| 
 | ||||
| void render_user_status(void) { | ||||
| void render_user_status(uint8_t col, uint8_t line) { | ||||
| #ifdef AUDIO_ENABLE | ||||
|     bool is_audio_on = false, l_is_clicky_on = false; | ||||
| #    ifdef SPLIT_KEYBOARD | ||||
| @ -472,7 +477,7 @@ void render_user_status(void) { | ||||
| #    endif | ||||
| #endif | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     oled_set_cursor(1, 5); | ||||
|     oled_set_cursor(col, line); | ||||
| #endif | ||||
|     oled_write_P(PSTR(OLED_RENDER_USER_NAME), false); | ||||
| #if !defined(OLED_DISPLAY_VERBOSE) | ||||
| @ -523,9 +528,27 @@ void render_user_status(void) { | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| void render_wpm(uint8_t padding) { | ||||
| #ifdef WPM_ENABLE | ||||
| void render_rgb_hsv(uint8_t col, uint8_t line) { | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_P(PSTR("HSV: "), false); | ||||
| #ifdef RGB_MATRIX_ENABLE | ||||
|     oled_write(get_u8_str(rgb_matrix_get_hue(), ' '), false); | ||||
|     oled_write_P(PSTR(", "), false); | ||||
|     oled_write(get_u8_str(rgb_matrix_get_sat(), ' '), false); | ||||
|     oled_write_P(PSTR(", "), false); | ||||
|     oled_write(get_u8_str(rgb_matrix_get_val(), ' '), false); | ||||
| #elif RGBLIGHT_ENABLE | ||||
|     oled_write(get_u8_str(rgblight_get_hue(), ' '), false); | ||||
|     oled_write_P(PSTR(", "), false); | ||||
|     oled_write(get_u8_str(rgblight_get_sat(), ' '), false); | ||||
|     oled_write_P(PSTR(", "), false); | ||||
|     oled_write(get_u8_str(rgblight_get_val(), ' '), false); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| void render_wpm(uint8_t padding, uint8_t col, uint8_t line) { | ||||
| #ifdef WPM_ENABLE | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_P(PSTR(OLED_RENDER_WPM_COUNTER), false); | ||||
|     if (padding) { | ||||
|         for (uint8_t n = padding; n > 0; n--) { | ||||
| @ -591,7 +614,8 @@ void render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset) { | ||||
| } | ||||
| 
 | ||||
| #if defined(POINTING_DEVICE_ENABLE) | ||||
| void render_pointing_dpi_status(uint16_t cpi, uint8_t padding) { | ||||
| void render_pointing_dpi_status(uint16_t cpi, uint8_t padding, uint8_t col, uint8_t line) { | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_P(PSTR("CPI:"), false); | ||||
|     if (padding) { | ||||
|         for (uint8_t n = padding - 1; n > 0; n--) { | ||||
| @ -603,13 +627,6 @@ void render_pointing_dpi_status(uint16_t cpi, uint8_t padding) { | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| __attribute__((weak)) void oled_driver_render_logo_right(void) { | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     oled_set_cursor(0, 1); | ||||
| #endif | ||||
|     render_default_layer_state(); | ||||
| } | ||||
| 
 | ||||
| // WPM-responsive animation stuff here
 | ||||
| #define OLED_SLEEP_FRAMES 2 | ||||
| #define OLED_SLEEP_SPEED 10 // below this wpm value your animation will idle
 | ||||
| @ -635,7 +652,7 @@ __attribute__((weak)) void oled_driver_render_logo_right(void) { | ||||
| static uint8_t animation_frame = 0; | ||||
| static uint8_t animation_type  = 0; | ||||
| 
 | ||||
| void render_kitty(void) { | ||||
| void render_kitty(uint8_t col, uint8_t line) { | ||||
|     // Images credit j-inc(/James Incandenza) and pixelbenny.
 | ||||
|     // Credit to obosob for initial animation approach.
 | ||||
|     // heavily modified by drashna because he's a glutton for punishment
 | ||||
| @ -712,11 +729,44 @@ void render_kitty(void) { | ||||
|     // clang-format on
 | ||||
| 
 | ||||
|     for (uint8_t i = 0; i < 4; i++) { | ||||
|         oled_set_cursor(1, i + 1); | ||||
|         oled_set_cursor(col, line + i); | ||||
|         oled_write_raw_P(animation[animation_type][animation_frame][i], OLED_ANIM_SIZE); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void render_unicode_mode(uint8_t col, uint8_t line) { | ||||
| #ifdef CUSTOM_UNICODE_ENABLE | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_ln_P(PSTR("Unicode:"), false); | ||||
|     switch (typing_mode) { | ||||
|         case UCTM_WIDE: | ||||
|             oled_write_P(PSTR("        Wide"), false); | ||||
|             break; | ||||
|         case UCTM_SCRIPT: | ||||
|             oled_write_P(PSTR("      Script"), false); | ||||
|             break; | ||||
|         case UCTM_BLOCKS: | ||||
|             oled_write_P(PSTR("      Blocks"), false); | ||||
|             break; | ||||
|         case UCTM_REGIONAL: | ||||
|             oled_write_P(PSTR("    Regional"), false); | ||||
|             break; | ||||
|         case UCTM_AUSSIE: | ||||
|             oled_write_P(PSTR("      Aussie"), false); | ||||
|             break; | ||||
|         case UCTM_ZALGO: | ||||
|             oled_write_P(PSTR("       Zalgo"), false); | ||||
|             break; | ||||
|         case UCTM_NO_MODE: | ||||
|             oled_write_P(PSTR("      Normal"), false); | ||||
|             break; | ||||
|         default: | ||||
|             oled_write_P(PSTR("     Unknown"), false); | ||||
|             break; | ||||
|     } | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { | ||||
|     static uint32_t anim_frame_duration = 500; | ||||
| #ifdef CUSTOM_POINTING_DEVICE | ||||
| @ -748,34 +798,8 @@ uint32_t kitty_animation_phases(uint32_t triger_time, void *cb_arg) { | ||||
|     return anim_frame_duration; | ||||
| } | ||||
| 
 | ||||
| void oled_driver_render_logo_left(void) { | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     oled_set_cursor(0, 1); | ||||
|     render_kitty(); | ||||
| 
 | ||||
| #    if defined(KEYBOARD_handwired_tractyl_manuform) | ||||
|     oled_set_cursor(7, 0); | ||||
|     oled_write_P(PSTR("Tractyl"), true); | ||||
| #    elif defined(KEYBOARD_bastardkb_charybdis) | ||||
|     oled_set_cursor(6, 0); | ||||
|     oled_write_P(PSTR("Charybdis"), true); | ||||
| #    elif defined(KEYBOARD_splitkb_kyria) | ||||
|     oled_set_cursor(7, 0); | ||||
|     oled_write_P(PSTR("SplitKB"), true); | ||||
| #    else | ||||
|     oled_set_cursor(8, 0); | ||||
|     oled_write_P(PSTR("Left"), true); | ||||
| #    endif | ||||
|     oled_set_cursor(7, 1); | ||||
| #    if defined(WPM_ENABLE) | ||||
|     render_wpm(1); | ||||
| #    elif defined(DEBUG_MATRIX_SCAN_RATE) | ||||
|     render_matrix_scan_rate(2); | ||||
| #    endif | ||||
|     oled_set_cursor(7, 2); | ||||
| void render_mouse_mode(uint8_t col, uint8_t line) { | ||||
| #if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) | ||||
|     render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1); | ||||
| 
 | ||||
|     // credit and thanks to jaspertandy on discord for these images
 | ||||
|     static const char PROGMEM mouse_logo[3][2][16] = {// mouse icon
 | ||||
|                                                       {{0, 0, 0, 252, 2, 2, 2, 58, 2, 2, 2, 252, 0, 0, 0, 0}, {0, 0, 63, 96, 64, 64, 64, 64, 64, 64, 64, 96, 63, 0, 0, 0}}, | ||||
| @ -795,17 +819,10 @@ void oled_driver_render_logo_left(void) { | ||||
|     } | ||||
| #    endif | ||||
| 
 | ||||
|     oled_set_cursor(17, 1); | ||||
|     oled_set_cursor(col, line); | ||||
|     oled_write_raw_P(mouse_logo[image_index][0], 16); | ||||
|     oled_set_cursor(17, 2); | ||||
|     oled_set_cursor(col, line + 1); | ||||
|     oled_write_raw_P(mouse_logo[image_index][1], 16); | ||||
| #    elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE) | ||||
|     render_matrix_scan_rate(2); | ||||
| #    endif | ||||
| 
 | ||||
|     oled_set_cursor(0, 5); | ||||
| #else | ||||
|     render_default_layer_state(); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| @ -823,27 +840,73 @@ void render_status_right(void) { | ||||
|     oled_set_cursor(8, 0); | ||||
|     oled_write_P(PSTR("Right"), true); | ||||
| #endif | ||||
|     oled_driver_render_logo_right(); | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     render_default_layer_state(1, 1); | ||||
| #else | ||||
|     render_default_layer_state(0, 0); | ||||
| #endif | ||||
| 
 | ||||
|     /* Show Keyboard Layout  */ | ||||
|     render_layer_state(); | ||||
|     render_mod_status(get_mods() | get_oneshot_mods()); | ||||
| #if !defined(OLED_DISPLAY_VERBOSE) && defined(WPM_ENABLE) && !defined(CONVERT_TO_PROTON_C) | ||||
|     render_layer_state(1, 2); | ||||
|     render_mod_status(get_mods() | get_oneshot_mods(), 1, 5); | ||||
| #if !defined(OLED_DISPLAY_VERBOSE) && defined(WPM_ENABLE) && !defined(STM32F303xC) | ||||
|     render_wpm(2); | ||||
| #endif | ||||
|     render_keylock_status(host_keyboard_led_state()); | ||||
|     render_keylock_status(host_keyboard_led_state(), 1, 6); | ||||
| } | ||||
| 
 | ||||
| void render_status_left(void) { | ||||
|     oled_driver_render_logo_left(); | ||||
| #if defined(OLED_DISPLAY_VERBOSE) | ||||
|     render_kitty(0, 1); | ||||
| 
 | ||||
| #    if defined(KEYBOARD_handwired_tractyl_manuform) | ||||
|     oled_set_cursor(7, 0); | ||||
|     oled_write_P(PSTR("Tractyl"), true); | ||||
| #    elif defined(KEYBOARD_bastardkb_charybdis) | ||||
|     oled_set_cursor(6, 0); | ||||
|     oled_write_P(PSTR("Charybdis"), true); | ||||
| #    elif defined(KEYBOARD_splitkb_kyria) | ||||
|     oled_set_cursor(7, 0); | ||||
|     oled_write_P(PSTR("SplitKB"), true); | ||||
| #    elif defined(KEYBOARD_handwired_fingerpunch_rockon) | ||||
|     oled_set_cursor(7, 0); | ||||
|     oled_write_P(PSTR("Rock On"), true); | ||||
| #    else | ||||
|     oled_set_cursor(8, 0); | ||||
|     oled_write_P(PSTR("Left"), true); | ||||
| #    endif | ||||
| 
 | ||||
| #    if defined(WPM_ENABLE) | ||||
|     render_wpm(1, 7, 1); | ||||
| #    elif defined(DEBUG_MATRIX_SCAN_RATE) | ||||
|     render_matrix_scan_rate(1, 7, 1); | ||||
| #    endif | ||||
| #    if (defined(KEYBOARD_bastardkb_charybdis) || defined(KEYBOARD_handwired_tractyl_manuform)) && defined(POINTING_DEVICE_ENABLE) | ||||
|     render_pointing_dpi_status(charybdis_get_pointer_sniping_enabled() ? charybdis_get_pointer_sniping_dpi() : charybdis_get_pointer_default_dpi(), 1, 7, 2); | ||||
|     render_mouse_mode(17, 1); | ||||
| #    elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE) | ||||
|     render_matrix_scan_rate(1, 7, 2); | ||||
| #    endif | ||||
|     /* Show Keyboard Layout  */ | ||||
|     render_bootmagic_status(); | ||||
|     render_user_status(); | ||||
|     render_bootmagic_status(7, 3); | ||||
|     render_user_status(1, 5); | ||||
| 
 | ||||
|     render_keylogger_status(); | ||||
|     render_keylogger_status(1, 6); | ||||
| #else | ||||
|     render_default_layer_state(0, 0); | ||||
|     /* Show Keyboard Layout  */ | ||||
|     render_bootmagic_status(7, 3); | ||||
|     render_user_status(1, 5); | ||||
| 
 | ||||
|     render_keylogger_status(1, 6); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) void oled_render_large_display(bool side) {} | ||||
| __attribute__((weak)) void oled_render_large_display(bool side) { | ||||
|     if (!side) { | ||||
|         render_unicode_mode(1, 14); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { | ||||
|     return rotation; | ||||
| @ -895,14 +958,12 @@ bool oled_task_user(void) { | ||||
| #endif | ||||
|         render_status_left(); | ||||
| #if defined(OLED_DISPLAY_128X128) | ||||
|         oled_set_cursor(0, 7); | ||||
|         oled_render_large_display(true); | ||||
| #endif | ||||
| #ifndef OLED_DISPLAY_TEST | ||||
|     } else { | ||||
|         render_status_right(); | ||||
| #    if defined(OLED_DISPLAY_128X128) | ||||
|         oled_set_cursor(0, 7); | ||||
|         oled_render_large_display(false); | ||||
| #    endif | ||||
|     } | ||||
|  | ||||
| @ -18,31 +18,35 @@ | ||||
| 
 | ||||
| #include "quantum.h" | ||||
| #include "oled_driver.h" | ||||
| #ifdef DEFFERED_EXEC_ENABLE | ||||
| extern deferred_token kittoken; | ||||
| #endif | ||||
| 
 | ||||
| void            oled_driver_render_logo(void); | ||||
| bool            process_record_user_oled(uint16_t keycode, keyrecord_t *record); | ||||
| oled_rotation_t oled_init_keymap(oled_rotation_t rotation); | ||||
| void            oled_timer_reset(void); | ||||
| void            render_keylogger_status(void); | ||||
| void            render_default_layer_state(void); | ||||
| void            render_layer_state(void); | ||||
| void            render_keylock_status(led_t led_usb_state); | ||||
| void            render_matrix_scan_rate(uint8_t padding); | ||||
| void            render_mod_status(uint8_t modifiers); | ||||
| void            render_bootmagic_status(void); | ||||
| void            render_user_status(void); | ||||
| void            render_keylogger_status(uint8_t col, uint8_t line); | ||||
| void            render_default_layer_state(uint8_t col, uint8_t line); | ||||
| void            render_layer_state(uint8_t col, uint8_t line); | ||||
| void            render_keylock_status(led_t led_usb_state, uint8_t col, uint8_t line); | ||||
| void            render_matrix_scan_rate(uint8_t padding, uint8_t col, uint8_t line); | ||||
| void            render_mod_status(uint8_t modifiers, uint8_t col, uint8_t line); | ||||
| void            render_bootmagic_status(uint8_t col, uint8_t line); | ||||
| void            render_user_status(uint8_t col, uint8_t line); | ||||
| void            oled_driver_render_logo(void); | ||||
| void            render_wpm(uint8_t padding); | ||||
| void            render_pointing_dpi_status(uint16_t cpi, uint8_t padding); | ||||
| void            render_wpm(uint8_t padding, uint8_t col, uint8_t line); | ||||
| void            render_pointing_dpi_status(uint16_t cpi, uint8_t padding, uint8_t col, uint8_t line); | ||||
| void            oled_driver_render_logo_left(void); | ||||
| void            oled_driver_render_logo_right(void); | ||||
| void            oled_render_large_display(bool side); | ||||
| void            render_wpm_graph(uint8_t max_lines_graph, uint8_t vertical_offset); | ||||
| void            render_kitty(uint8_t col, uint8_t line); | ||||
| void            render_unicode_mode(uint8_t col, uint8_t line); | ||||
| void            render_rgb_hsv(uint8_t col, uint8_t line); | ||||
| 
 | ||||
| void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_start, uint16_t x_end); | ||||
| 
 | ||||
| 
 | ||||
| #if defined(OLED_DISPLAY_128X128) || defined(OLED_DISPLAY_128X64) | ||||
| #    define OLED_DISPLAY_VERBOSE | ||||
| 
 | ||||
| @ -142,7 +146,6 @@ void oled_pan_section(bool left, uint16_t y_start, uint16_t y_end, uint16_t x_st | ||||
| #    define OLED_RENDER_WPM_COUNTER "WPM: " | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
| extern char keylog_str[OLED_KEYLOGGER_LENGTH]; | ||||
| 
 | ||||
| #ifndef OLED_WPM_GRAPH_MAX_WPM | ||||
|  | ||||
| @ -261,8 +261,12 @@ bool oled_init(oled_rotation_t rotation) { | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { return rotation; } | ||||
| __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return rotation; } | ||||
| __attribute__((weak)) oled_rotation_t oled_init_kb(oled_rotation_t rotation) { | ||||
|     return rotation; | ||||
| } | ||||
| __attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||||
|     return rotation; | ||||
| } | ||||
| 
 | ||||
| void oled_clear(void) { | ||||
|     memset(oled_buffer, 0, sizeof(oled_buffer)); | ||||
| @ -414,7 +418,8 @@ void oled_advance_page(bool clearPageRemainder) { | ||||
|         remaining = remaining / OLED_FONT_WIDTH; | ||||
| 
 | ||||
|         // Write empty character until next line
 | ||||
|         while (remaining--) oled_write_char(' ', false); | ||||
|         while (remaining--) | ||||
|             oled_write_char(' ', false); | ||||
|     } else { | ||||
|         // Next page index out of bounds?
 | ||||
|         if (index + remaining >= OLED_MATRIX_SIZE) { | ||||
| @ -660,7 +665,9 @@ bool oled_off(void) { | ||||
|     return !oled_active; | ||||
| } | ||||
| 
 | ||||
| bool is_oled_on(void) { return oled_active; } | ||||
| bool is_oled_on(void) { | ||||
|     return oled_active; | ||||
| } | ||||
| 
 | ||||
| uint8_t oled_set_brightness(uint8_t level) { | ||||
|     if (!oled_initialized) { | ||||
| @ -678,7 +685,9 @@ uint8_t oled_set_brightness(uint8_t level) { | ||||
|     return oled_brightness; | ||||
| } | ||||
| 
 | ||||
| uint8_t oled_get_brightness(void) { return oled_brightness; } | ||||
| uint8_t oled_get_brightness(void) { | ||||
|     return oled_brightness; | ||||
| } | ||||
| 
 | ||||
| // Set the specific 8 lines rows of the screen to scroll.
 | ||||
| // 0 is the default for start, and 7 for end, which is the entire
 | ||||
| @ -758,7 +767,9 @@ bool oled_scroll_off(void) { | ||||
|     return !oled_scrolling; | ||||
| } | ||||
| 
 | ||||
| bool is_oled_scrolling(void) { return oled_scrolling; } | ||||
| bool is_oled_scrolling(void) { | ||||
|     return oled_scrolling; | ||||
| } | ||||
| 
 | ||||
| bool oled_invert(bool invert) { | ||||
|     if (!oled_initialized) { | ||||
| @ -842,6 +853,9 @@ void oled_task(void) { | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| __attribute__((weak)) bool oled_task_kb(void) { return oled_task_user(); } | ||||
| __attribute__((weak)) bool oled_task_user(void) { return true; } | ||||
| __attribute__((weak)) bool oled_task_kb(void) { | ||||
|     return oled_task_user(); | ||||
| } | ||||
| __attribute__((weak)) bool oled_task_user(void) { | ||||
|     return true; | ||||
| } | ||||
|  | ||||
| @ -59,6 +59,8 @@ void keyboard_post_init_rgb_matrix(void) { | ||||
| #endif | ||||
|     if (userspace_config.rgb_layer_change) { | ||||
|         rgb_matrix_set_flags(LED_FLAG_UNDERGLOW | LED_FLAG_KEYLIGHT | LED_FLAG_INDICATOR); | ||||
|     } else { | ||||
|         rgb_matrix_set_flags(LED_FLAG_ALL); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @ -86,9 +88,13 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { return true; } | ||||
| __attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { | ||||
|     return true; | ||||
| } | ||||
| void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { | ||||
|     if (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { return; } | ||||
|     if (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
| #if defined(RGBLIGHT_ENABLE) | ||||
|     if (!userspace_config.rgb_layer_change) | ||||
| @ -96,19 +102,7 @@ void                       rgb_matrix_indicators_advanced_user(uint8_t led_min, | ||||
|     if (userspace_config.rgb_layer_change) | ||||
| #endif | ||||
|     { | ||||
|         switch (get_highest_layer(layer_state | default_layer_state)) { | ||||
|             case _DEFAULT_LAYER_1: | ||||
|                 rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
|             case _DEFAULT_LAYER_2: | ||||
|                 rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
|             case _DEFAULT_LAYER_3: | ||||
|                 rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
|             case _DEFAULT_LAYER_4: | ||||
|                 rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
|         switch (get_highest_layer(layer_state & ~((layer_state_t)1 << _MOUSE))) { | ||||
|             case _GAMEPAD: | ||||
|                 rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
| @ -124,9 +118,33 @@ void                       rgb_matrix_indicators_advanced_user(uint8_t led_min, | ||||
|             case _ADJUST: | ||||
|                 rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 break; | ||||
|             default: | ||||
|                 if (layer_state_is(_MOUSE)) { | ||||
|                     rgb_matrix_layer_helper(HSV_PURPLE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                 } else { | ||||
|                     switch (get_highest_layer(default_layer_state)) { | ||||
|                         case _DEFAULT_LAYER_1: | ||||
|                             rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                             break; | ||||
|                         case _DEFAULT_LAYER_2: | ||||
|                             rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                             break; | ||||
|                         case _DEFAULT_LAYER_3: | ||||
|                             rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                             break; | ||||
|                         case _DEFAULT_LAYER_4: | ||||
|                             rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max); | ||||
|                             break; | ||||
|                     } | ||||
|                 } | ||||
|                 break; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { return true; } | ||||
| void                       rgb_matrix_indicators_user(void) { rgb_matrix_indicators_keymap(); } | ||||
| __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { | ||||
|     return true; | ||||
| } | ||||
| void rgb_matrix_indicators_user(void) { | ||||
|     rgb_matrix_indicators_keymap(); | ||||
| } | ||||
|  | ||||
| @ -1,22 +1,24 @@ | ||||
| // Copyright 2020 Christopher Courtney, aka Drashna Jael're  (@drashna) <drashna@live.com>
 | ||||
| // SPDX-License-Identifier: GPL-2.0-or-later
 | ||||
| 
 | ||||
| #ifdef RGBLIGHT_ENABLE | ||||
| 
 | ||||
| #include "drashna.h" | ||||
| #include "rgb_stuff.h" | ||||
| #include "eeprom.h" | ||||
| 
 | ||||
| bool has_initialized; | ||||
| 
 | ||||
| void rgblight_sethsv_default_helper(uint8_t index) { rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); } | ||||
| void rgblight_sethsv_default_helper(uint8_t index) { | ||||
|     rgblight_sethsv_at(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val(), index); | ||||
| } | ||||
| void rgblight_set_hsv_and_mode(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode) { | ||||
|     rgblight_sethsv_noeeprom(hue, sat, val); | ||||
|     // wait_us(175);  // Add a slight delay between color and mode to ensure it's processed correctly
 | ||||
|     rgblight_mode_noeeprom(mode); | ||||
| } | ||||
| 
 | ||||
| bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { return true; } | ||||
| bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record) { | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| #if defined(RGBLIGHT_STARTUP_ANIMATION) | ||||
| static bool    is_enabled; | ||||
| @ -61,22 +63,12 @@ void keyboard_post_init_rgb_light(void) { | ||||
|     if (userspace_config.rgb_layer_change) { | ||||
|         layer_state_set_rgb_light(layer_state); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| layer_state_t layer_state_set_rgb_light(layer_state_t state) { | ||||
| #ifdef RGBLIGHT_ENABLE | ||||
|     if (userspace_config.rgb_layer_change) { | ||||
|         switch (get_highest_layer(state | default_layer_state)) { | ||||
|             case _MOUSE:  // mouse
 | ||||
|                 if (!layer_state_cmp(state, _GAMEPAD) && !layer_state_cmp(state, _DIABLO)) { | ||||
| #        if defined(RGBLIGHT_EFFECT_TWINKLE) | ||||
|                     rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); | ||||
| #        else | ||||
|                     rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); | ||||
| #        endif | ||||
|                 } | ||||
|                 break; | ||||
|         switch (get_highest_layer(state & ~((layer_state_t)1 << _MOUSE))) { | ||||
|             case _MEDIA: | ||||
|                 rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_KNIGHT + 1); | ||||
|                 break; | ||||
| @ -84,6 +76,7 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) { | ||||
|                 rgblight_set_hsv_and_mode(HSV_ORANGE, RGBLIGHT_MODE_SNAKE + 2); | ||||
|                 break; | ||||
|             case _DIABLO: | ||||
|             case _DIABLOII: | ||||
|                 rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_BREATHING + 3); | ||||
|                 break; | ||||
|             case _RAISE: | ||||
| @ -95,6 +88,24 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) { | ||||
|             case _ADJUST: | ||||
|                 rgblight_set_hsv_and_mode(HSV_RED, RGBLIGHT_MODE_KNIGHT + 2); | ||||
|                 break; | ||||
|             default: | ||||
|                 if (layer_state_cmp(state, _MOUSE)) { | ||||
| #    if defined(RGBLIGHT_EFFECT_TWINKLE) | ||||
|                     rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_TWINKLE + 5); | ||||
| #    else | ||||
|                     rgblight_set_hsv_and_mode(HSV_CHARTREUSE, RGBLIGHT_MODE_BREATHING + 3); | ||||
| #    endif | ||||
|                 } else { | ||||
|                     default_layer_state_set_rgb_light(default_layer_state); | ||||
|                 } | ||||
|         } | ||||
| #endif // RGBLIGHT_ENABLE
 | ||||
|     } | ||||
|     return state; | ||||
| } | ||||
| 
 | ||||
| layer_state_t default_layer_state_set_rgb_light(layer_state_t state) { | ||||
|     switch (get_highest_layer(state)) { | ||||
|         case _DEFAULT_LAYER_1: | ||||
|             rgblight_set_hsv_and_mode(DEFAULT_LAYER_1_HSV, RGBLIGHT_MODE_STATIC_LIGHT); | ||||
|             break; | ||||
| @ -108,10 +119,5 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) { | ||||
|             rgblight_set_hsv_and_mode(DEFAULT_LAYER_4_HSV, RGBLIGHT_MODE_STATIC_LIGHT); | ||||
|             break; | ||||
|     } | ||||
|     } | ||||
| #    endif  // RGBLIGHT_ENABLE
 | ||||
| 
 | ||||
|     return state; | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  | ||||
| @ -3,6 +3,8 @@ SRC += $(USER_PATH)/drashna.c \ | ||||
|         $(USER_PATH)/keyrecords/process_records.c \
 | ||||
|         $(USER_PATH)/keyrecords/tapping.c | ||||
| 
 | ||||
| # TOP_SYMBOLS = yes
 | ||||
| 
 | ||||
| ifneq ($(PLATFORM),CHIBIOS) | ||||
|     ifneq ($(strip $(LTO_SUPPORTED)), no) | ||||
|         LTO_ENABLE        = yes | ||||
| @ -15,6 +17,7 @@ GRAVE_ESC_ENABLE      = no | ||||
| ifneq ($(strip $(NO_SECRETS)), yes) | ||||
|     ifneq ("$(wildcard $(USER_PATH)/../../../qmk_secrets/secrets.c)","") | ||||
|         SRC += $(USER_PATH)/../../../qmk_secrets/secrets.c | ||||
|         $(shell touch $(USER_PATH)/../../../qmk_secrets/secrets.c) | ||||
|         SECURE_ENABLE = yes | ||||
|     endif | ||||
|     ifeq ($(strip $(NO_SECRETS)), lite) | ||||
| @ -103,7 +106,6 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) | ||||
|     ifeq ($(strip $(CUSTOM_POINTING_DEVICE)), yes) | ||||
|         SRC += $(USER_PATH)/pointing/pointing.c | ||||
|         OPT_DEFS += -DCUSTOM_POINTING_DEVICE | ||||
|         OPT_DEFS += -DMOUSE_EXT_REPORT | ||||
|     endif | ||||
| endif | ||||
| 
 | ||||
| @ -119,5 +121,6 @@ endif | ||||
| AUTOCORRECTION_ENABLE ?= no | ||||
| ifeq ($(strip $(AUTOCORRECTION_ENABLE)), yes) | ||||
|     SRC += $(USER_PATH)/keyrecords/autocorrection/autocorrection.c | ||||
|     $(shell touch $(USER_PATH)/keyrecords/autocorrection/autocorrection.c) | ||||
|     OPT_DEFS += -DAUTOCORRECTION_ENABLE | ||||
| endif | ||||
|  | ||||
| @ -55,7 +55,9 @@ void user_config_sync(uint8_t initiator2target_buffer_size, const void* initiato | ||||
| } | ||||
| 
 | ||||
| #if defined(SPLIT_WATCHDOG_TIMEOUT) | ||||
| void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { watchdog_ping_done = true; } | ||||
| void watchdog_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { | ||||
|     watchdog_ping_done = true; | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| #ifdef CUSTOM_OLED_DRIVER | ||||
| @ -233,7 +235,7 @@ void user_transport_sync(void) { | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| void housekeeping_task_user(void) { | ||||
| void housekeeping_task_transport_sync(void) { | ||||
|     // Update kb_state so we can send to slave
 | ||||
|     user_transport_update(); | ||||
| 
 | ||||
|  | ||||
| @ -25,3 +25,4 @@ typedef union { | ||||
| extern user_runtime_config_t user_state; | ||||
| 
 | ||||
| void keyboard_post_init_transport_sync(void); | ||||
| void housekeeping_task_transport_sync(void); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 QMK Bot
						QMK Bot