diff --git a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c index 56f2924f..6dcb5e3c 100644 --- a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c +++ b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c @@ -235,4 +235,40 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ // ), -}; \ No newline at end of file +}; + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + + if (index == 0) { + // Volume control + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + // Page up/Page down + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 2) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 3) { + // Page up/Page down + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return false; +} +#endif \ No newline at end of file diff --git a/users/halcyon_modules/config.h b/users/halcyon_modules/config.h index 7d35bb50..0ebd6e8a 100644 --- a/users/halcyon_modules/config.h +++ b/users/halcyon_modules/config.h @@ -3,34 +3,20 @@ #pragma once -#define SPLIT_POINTING_ENABLE - #define SPLIT_TRANSACTION_IDS_KB MODULE_SYNC #include_next -#undef RP_SPI_USE_SPI1 -#define RP_SPI_USE_SPI1 TRUE - #undef RP_PWM_USE_PWM5 #define RP_PWM_USE_PWM5 TRUE #define HAL_USE_PWM TRUE #define HAL_USE_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD +#define SPLIT_POINTING_ENABLE #define POINTING_DEVICE_COMBINED -// Blank SPI config, otherwise a SPI module won't work as slave -#if !defined(HLC_SPI_DEVICE) - #define SPI_SCK_PIN GP0 //NOT CONNECTED - #define SPI_MOSI_PIN NO_PIN - #define SPI_MISO_PIN NO_PIN - - #undef SPI_SELECT_MODE - #define SPI_SELECT_MODE SPI_SELECT_MODE_NONE -#endif +#define HLC_BACKLIGHT_TIMEOUT 120000 #if !defined(HLC_TFT_DISPLAY) #define BACKLIGHT_PIN NO_PIN diff --git a/users/halcyon_modules/halcyon.c b/users/halcyon_modules/halcyon.c index 8b00e678..c12c0842 100644 --- a/users/halcyon_modules/halcyon.c +++ b/users/halcyon_modules/halcyon.c @@ -43,6 +43,20 @@ module_t module; module_t module = hlc_tft_display; #endif +bool backlight_off = false; + +// Timeout handling +void backlight_wakeup(void) { + backlight_off = false; + backlight_enable(); +} + +// Timeout handling +void backlight_suspend(void) { + backlight_off = true; + backlight_disable(); +} + void module_sync_slave_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) { if (initiator2target_buffer_size == sizeof(module)) { memcpy(&module_master, initiator2target_buffer, sizeof(module_master)); @@ -76,6 +90,15 @@ void housekeeping_task_kb(void) { display_module_housekeeping_task_kb(false); // Otherwise be the main display } } + + // Backlight feature + if (backlight_off && last_input_activity_elapsed() <= HLC_BACKLIGHT_TIMEOUT) { + backlight_wakeup(); + } + if (!backlight_off && last_input_activity_elapsed() > HLC_BACKLIGHT_TIMEOUT) { + backlight_suspend(); + } + module_housekeeping_task_kb(); housekeeping_task_user(); diff --git a/users/halcyon_modules/hlc_cirque_trackpad/config.h b/users/halcyon_modules/hlc_cirque_trackpad/config.h index 6a4be5e5..2d21a576 100644 --- a/users/halcyon_modules/hlc_cirque_trackpad/config.h +++ b/users/halcyon_modules/hlc_cirque_trackpad/config.h @@ -8,11 +8,6 @@ #define HLC_SPI_DEVICE #define HLC_CIRQUE_TRACKPAD -#define SPI_DRIVER SPID1 -#define SPI_SCK_PIN GP14 -#define SPI_MOSI_PIN GP15 -#define SPI_MISO_PIN GP12 - #define CIRQUE_PINNACLE_DIAMETER_MM 35 #define POINTING_DEVICE_CS_PIN GP13 #define POINTING_DEVICE_ROTATION_180 diff --git a/users/halcyon_modules/hlc_tft_display/config.h b/users/halcyon_modules/hlc_tft_display/config.h index 3619fda2..2e839459 100644 --- a/users/halcyon_modules/hlc_tft_display/config.h +++ b/users/halcyon_modules/hlc_tft_display/config.h @@ -8,11 +8,6 @@ #define HLC_SPI_DEVICE #define HLC_TFT_DISPLAY -#define SPI_DRIVER SPID1 -#define SPI_SCK_PIN GP14 -#define SPI_MOSI_PIN GP15 -#define SPI_MISO_PIN GP12 - // LCD Configuration #define LCD_RST_PIN GP26 #define LCD_CS_PIN GP13 @@ -40,4 +35,4 @@ #define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B // Timeout configuration -#define QUANTUM_PAINTER_DISPLAY_TIMEOUT 120000 \ No newline at end of file +#define QUANTUM_PAINTER_DISPLAY_TIMEOUT HLC_BACKLIGHT_TIMEOUT \ No newline at end of file diff --git a/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c b/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c index 9931122f..4aad825f 100644 --- a/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c +++ b/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c @@ -42,7 +42,6 @@ backlight_config_t backlight_config; static uint16_t lcd_surface_fb[135*240]; -bool backlight_off = false; int color_value = 0; led_t last_led_usb_state = {0}; @@ -243,7 +242,6 @@ void update_display(void) { // Quantum function void suspend_power_down_kb(void) { - // backlight_suspend(); Disabled as it gives some weird behavior when rebooting the host qp_power(lcd, false); suspend_power_down_user(); } @@ -251,22 +249,9 @@ void suspend_power_down_kb(void) { // Quantum function void suspend_wakeup_init_kb(void) { qp_power(lcd, true); - // backlight_wakeup(); Disabled as it gives some weird behavior when rebooting the host suspend_wakeup_init_user(); } -// Timeout handling -void backlight_wakeup(void) { - backlight_off = false; - backlight_enable(); -} - -// Timeout handling -void backlight_suspend(void) { - backlight_off = true; - backlight_disable(); -} - // Called from halcyon.c bool module_post_init_kb(void) { setPinOutput(LCD_RST_PIN); @@ -296,14 +281,6 @@ bool module_post_init_kb(void) { // Called from halcyon.c bool display_module_housekeeping_task_kb(bool second_display) { - // Backlight feature - if (backlight_off && last_input_activity_elapsed() <= QUANTUM_PAINTER_DISPLAY_TIMEOUT) { - backlight_wakeup(); - } - if (!backlight_off && last_input_activity_elapsed() > QUANTUM_PAINTER_DISPLAY_TIMEOUT) { - backlight_suspend(); - } - if(!display_module_housekeeping_task_user(second_display)) { return false; } if(second_display) {