diff --git a/examples/display/display.c b/examples/display/display.c index 39a88573..eb70a1b0 100644 --- a/examples/display/display.c +++ b/examples/display/display.c @@ -10,6 +10,9 @@ // Initialize the font static painter_font_handle_t thintel; +painter_device_t lcd; +painter_device_t lcd_surface; + // This function is ran on bootup of the keyboard bool module_post_init_user(void) { // Load the font in to memory. @@ -55,12 +58,12 @@ bool display_module_housekeeping_task_user(bool second_display) { // Make sure that the second display loads correctly, sometimes it takes a little while for the keyboard to know it has a second display. // So we reset the state and make it run again until the secondary display is drawn correctly - if(second_display && !second_display_set) { + if(second_display && !second_display_set) { display_set = false; } // Move surface to lcd, this actually writes the content to the physical display qp_surface_draw(lcd_surface, lcd, 0, 0, 0); - + return false; -} \ No newline at end of file +} diff --git a/examples/display/rules.mk b/examples/display/rules.mk index e7e17fbb..a45bcb6b 100644 --- a/examples/display/rules.mk +++ b/examples/display/rules.mk @@ -2,4 +2,4 @@ SRC += display.c # Include the font file -SRC += graphics/thintel15.qff.c \ No newline at end of file +SRC += graphics/thintel15.qff.c diff --git a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c index 2fe0c771..4745d2a9 100644 --- a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c +++ b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/keymap.c @@ -271,4 +271,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } return false; } -#endif \ No newline at end of file +#endif diff --git a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/rules.mk b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/rules.mk index 70ffc544..54a02a4c 100644 --- a/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/rules.mk +++ b/keyboards/splitkb/halcyon/kyria/keymaps/default_hlc/rules.mk @@ -1,2 +1,2 @@ # This adds module functionality to your keyboard (files found in users/halcyon_modules) -USER_NAME := halcyon_modules \ No newline at end of file +USER_NAME := halcyon_modules diff --git a/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/config.h b/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/config.h index 1453da7d..ef42b2fb 100644 --- a/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/config.h +++ b/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/config.h @@ -14,4 +14,4 @@ #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES -#define DYNAMIC_KEYMAP_LAYER_COUNT 8 \ No newline at end of file +#define DYNAMIC_KEYMAP_LAYER_COUNT 8 diff --git a/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/rules.mk b/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/rules.mk index b8636a7a..27f651ed 100644 --- a/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/rules.mk +++ b/keyboards/splitkb/halcyon/kyria/keymaps/vial_hlc/rules.mk @@ -5,4 +5,4 @@ VIALRGB_ENABLE = yes ENCODER_MAP_ENABLE = yes # This adds module functionality to your keyboard (files found in users/halcyon_modules) -USER_NAME := halcyon_modules \ No newline at end of file +USER_NAME := halcyon_modules diff --git a/users/halcyon_modules/config.h b/users/halcyon_modules/config.h index d09a0085..c36bbb1e 100644 --- a/users/halcyon_modules/config.h +++ b/users/halcyon_modules/config.h @@ -64,4 +64,4 @@ {k8A, k8B, k8C, k8D, k8E, k8F, KC_NO}, \ {k9A, k9B, k9C, k9D, k9E, KC_NO, KC_NO} \ } -#endif \ No newline at end of file +#endif diff --git a/users/halcyon_modules/halcyon.c b/users/halcyon_modules/halcyon.c index 8187f57a..3916ad94 100644 --- a/users/halcyon_modules/halcyon.c +++ b/users/halcyon_modules/halcyon.c @@ -25,6 +25,7 @@ __attribute__((weak)) bool display_module_housekeeping_task_user(bool second_dis return true; } +module_t module_master; module_t module; #ifdef HLC_NONE module_t module = hlc_none; @@ -91,7 +92,7 @@ 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(); @@ -153,4 +154,4 @@ const matrix_row_t matrix_mask[] = { 0b0011111, }; #endif -#endif \ No newline at end of file +#endif diff --git a/users/halcyon_modules/halcyon.h b/users/halcyon_modules/halcyon.h index 37e1cda4..2f1878c0 100644 --- a/users/halcyon_modules/halcyon.h +++ b/users/halcyon_modules/halcyon.h @@ -11,11 +11,11 @@ typedef enum module { hlc_tft_display } module_t; -module_t module_master; +extern module_t module_master; bool module_post_init_kb(void); bool module_housekeeping_task_kb(void); bool display_module_housekeeping_task_kb(bool second_display); bool module_post_init_user(void); bool module_housekeeping_task_user(void); -bool display_module_housekeeping_task_user(bool second_display); \ No newline at end of file +bool display_module_housekeeping_task_user(bool second_display); diff --git a/users/halcyon_modules/hlc_cirque_trackpad/config.h b/users/halcyon_modules/hlc_cirque_trackpad/config.h index cbae5653..e93ae55e 100644 --- a/users/halcyon_modules/hlc_cirque_trackpad/config.h +++ b/users/halcyon_modules/hlc_cirque_trackpad/config.h @@ -15,4 +15,4 @@ #define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE #define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE #define CIRQUE_PINNACLE_TAP_ENABLE -#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE \ No newline at end of file +#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE diff --git a/users/halcyon_modules/hlc_cirque_trackpad/rules.mk b/users/halcyon_modules/hlc_cirque_trackpad/rules.mk index 2821d65f..a4983b87 100644 --- a/users/halcyon_modules/hlc_cirque_trackpad/rules.mk +++ b/users/halcyon_modules/hlc_cirque_trackpad/rules.mk @@ -1,3 +1,3 @@ CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) -CONFIG_H += $(CURRENT_DIR)/config.h \ No newline at end of file +CONFIG_H += $(CURRENT_DIR)/config.h diff --git a/users/halcyon_modules/hlc_encoder/config.h b/users/halcyon_modules/hlc_encoder/config.h index 44fe802d..0eed0c0f 100644 --- a/users/halcyon_modules/hlc_encoder/config.h +++ b/users/halcyon_modules/hlc_encoder/config.h @@ -9,4 +9,4 @@ #define HLC_ENCODER_BUTTON GP16 #define HLC_ENCODER_A GP27 -#define HLC_ENCODER_B GP26 \ No newline at end of file +#define HLC_ENCODER_B GP26 diff --git a/users/halcyon_modules/hlc_encoder/hlc_encoder.c b/users/halcyon_modules/hlc_encoder/hlc_encoder.c index d245eefd..d6ea650b 100644 --- a/users/halcyon_modules/hlc_encoder/hlc_encoder.c +++ b/users/halcyon_modules/hlc_encoder/hlc_encoder.c @@ -124,7 +124,7 @@ void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // Populate the matrix row with the state of the col pin current_row_value |= pin_state ? 0 : row_shifter; } - } + } // ↑↑↑ THIS HAS BEEN ADDED/CHANGED // Unselect row @@ -133,4 +133,4 @@ void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // Update the matrix current_matrix[current_row] = current_row_value; -} \ No newline at end of file +} diff --git a/users/halcyon_modules/hlc_encoder/rules.mk b/users/halcyon_modules/hlc_encoder/rules.mk index 03fc7e47..0db09e4c 100644 --- a/users/halcyon_modules/hlc_encoder/rules.mk +++ b/users/halcyon_modules/hlc_encoder/rules.mk @@ -1,4 +1,4 @@ CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) SRC += $(CURRENT_DIR)/hlc_encoder.c -CONFIG_H += $(CURRENT_DIR)/config.h \ No newline at end of file +CONFIG_H += $(CURRENT_DIR)/config.h diff --git a/users/halcyon_modules/hlc_tft_display/config.h b/users/halcyon_modules/hlc_tft_display/config.h index c8657970..41b61ac9 100644 --- a/users/halcyon_modules/hlc_tft_display/config.h +++ b/users/halcyon_modules/hlc_tft_display/config.h @@ -31,4 +31,4 @@ #define BACKLIGHT_PIN GP27 // Timeout configuration -#define QUANTUM_PAINTER_DISPLAY_TIMEOUT HLC_BACKLIGHT_TIMEOUT \ No newline at end of file +#define QUANTUM_PAINTER_DISPLAY_TIMEOUT HLC_BACKLIGHT_TIMEOUT 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 bbb4f82e..28166951 100644 --- a/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c +++ b/users/halcyon_modules/hlc_tft_display/hlc_tft_display.c @@ -37,6 +37,9 @@ static uint16_t lcd_surface_fb[135*240]; int color_value = 0; +painter_device_t lcd; +painter_device_t lcd_surface; + led_t last_led_usb_state = {0}; layer_state_t last_layer_state = {0}; @@ -81,7 +84,7 @@ void draw_grid() { // Draw the filled cell inside the outline if it's alive if (grid[y][x]) { switch (color_value) { - case 0: + case 0: qp_rect(lcd_surface, left + OUTLINE_SIZE, top + OUTLINE_SIZE, right - OUTLINE_SIZE, bottom - OUTLINE_SIZE, HSV_LAYER_0, true); break; case 1: @@ -93,7 +96,7 @@ void draw_grid() { case 3: qp_rect(lcd_surface, left + OUTLINE_SIZE, top + OUTLINE_SIZE, right - OUTLINE_SIZE, bottom - OUTLINE_SIZE, HSV_LAYER_3, true); break; - case 4: + case 4: qp_rect(lcd_surface, left + OUTLINE_SIZE, top + OUTLINE_SIZE, right - OUTLINE_SIZE, bottom - OUTLINE_SIZE, HSV_LAYER_4, true); break; case 5: @@ -188,10 +191,10 @@ void update_display(void) { last_led_usb_state = led_usb_state; first_run_led = true; } - + if(last_layer_state != layer_state || first_run_layer == false) { switch (get_highest_layer(layer_state|default_layer_state)) { - case 0: + case 0: layer_number = qp_load_image_mem(gfx_0); qp_drawimage_recolor(lcd_surface, 5, 5, layer_number, HSV_LAYER_0, HSV_BLACK); break; @@ -207,7 +210,7 @@ void update_display(void) { layer_number = qp_load_image_mem(gfx_3); qp_drawimage_recolor(lcd_surface, 5, 5, layer_number, HSV_LAYER_3, HSV_BLACK); break; - case 4: + case 4: layer_number = qp_load_image_mem(gfx_4); qp_drawimage_recolor(lcd_surface, 5, 5, layer_number, HSV_LAYER_4, HSV_BLACK); break; @@ -234,7 +237,7 @@ void update_display(void) { } // Quantum function -void suspend_power_down_kb(void) { +void suspend_power_down_kb(void) { qp_power(lcd, false); suspend_power_down_user(); } @@ -273,7 +276,7 @@ bool module_post_init_kb(void) { } // Called from halcyon.c -bool display_module_housekeeping_task_kb(bool second_display) { +bool display_module_housekeeping_task_kb(bool second_display) { if(!display_module_housekeeping_task_user(second_display)) { return false; } if(second_display) { @@ -288,7 +291,7 @@ bool display_module_housekeeping_task_kb(bool second_display) { second_display_set = true; } - if (timer_elapsed32(last_draw) >= 100) { // Throttle to 10 fps + if (timer_elapsed32(last_draw) >= 100) { // Throttle to 10 fps draw_grid(); update_grid(); @@ -311,4 +314,4 @@ bool display_module_housekeeping_task_kb(bool second_display) { qp_surface_draw(lcd_surface, lcd, 0, 0, 0); return true; -} \ No newline at end of file +} diff --git a/users/halcyon_modules/hlc_tft_display/hlc_tft_display.h b/users/halcyon_modules/hlc_tft_display/hlc_tft_display.h index 93a2c79f..45bab704 100644 --- a/users/halcyon_modules/hlc_tft_display/hlc_tft_display.h +++ b/users/halcyon_modules/hlc_tft_display/hlc_tft_display.h @@ -25,8 +25,8 @@ // #define HSV_LAYER_8 213, 56, 255 #define HSV_LAYER_UNDEF 0, 255, 255 -painter_device_t lcd; -painter_device_t lcd_surface; +extern painter_device_t lcd; +extern painter_device_t lcd_surface; void draw_grid(void); void update_grid(void); @@ -35,4 +35,4 @@ void add_cell_cluster(void); uint8_t get_random_color_index(void); void update_display(void); void backlight_wakeup(void); -void backlight_suspend(void); \ No newline at end of file +void backlight_suspend(void); diff --git a/users/halcyon_modules/hlc_tft_display/rules.mk b/users/halcyon_modules/hlc_tft_display/rules.mk index 48978c7e..34319ae9 100644 --- a/users/halcyon_modules/hlc_tft_display/rules.mk +++ b/users/halcyon_modules/hlc_tft_display/rules.mk @@ -1,9 +1,9 @@ CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) -SRC += $(CURRENT_DIR)/hlc_tft_display.c +SRC += $(CURRENT_DIR)/hlc_tft_display.c CONFIG_H += $(CURRENT_DIR)/config.h # Fonts SRC += $(CURRENT_DIR)/graphics/fonts/Retron2000-27.qff.c $(CURRENT_DIR)/graphics/fonts/Retron2000-underline-27.qff.c # Numbers in image format -SRC += $(CURRENT_DIR)/graphics/numbers/0.qgf.c $(CURRENT_DIR)/graphics/numbers/1.qgf.c $(CURRENT_DIR)/graphics/numbers/2.qgf.c $(CURRENT_DIR)/graphics/numbers/3.qgf.c $(CURRENT_DIR)/graphics/numbers/4.qgf.c $(CURRENT_DIR)/graphics/numbers/5.qgf.c $(CURRENT_DIR)/graphics/numbers/6.qgf.c $(CURRENT_DIR)/graphics/numbers/7.qgf.c $(CURRENT_DIR)/graphics/numbers/8.qgf.c $(CURRENT_DIR)/graphics/numbers/9.qgf.c $(CURRENT_DIR)/graphics/numbers/undef.qgf.c \ No newline at end of file +SRC += $(CURRENT_DIR)/graphics/numbers/0.qgf.c $(CURRENT_DIR)/graphics/numbers/1.qgf.c $(CURRENT_DIR)/graphics/numbers/2.qgf.c $(CURRENT_DIR)/graphics/numbers/3.qgf.c $(CURRENT_DIR)/graphics/numbers/4.qgf.c $(CURRENT_DIR)/graphics/numbers/5.qgf.c $(CURRENT_DIR)/graphics/numbers/6.qgf.c $(CURRENT_DIR)/graphics/numbers/7.qgf.c $(CURRENT_DIR)/graphics/numbers/8.qgf.c $(CURRENT_DIR)/graphics/numbers/9.qgf.c $(CURRENT_DIR)/graphics/numbers/undef.qgf.c diff --git a/users/halcyon_modules/rules.mk b/users/halcyon_modules/rules.mk index d121e5e4..8136ecc4 100644 --- a/users/halcyon_modules/rules.mk +++ b/users/halcyon_modules/rules.mk @@ -6,7 +6,7 @@ LTO_ENABLE ?= yes # May need to be changed when adding more pointing devices POINTING_DEVICE_ENABLE = yes -POINTING_DEVICE_DRIVER = cirque_pinnacle_spi +POINTING_DEVICE_DRIVER = cirque_pinnacle_spi # May need to be changed when adding more displays QUANTUM_PAINTER_ENABLE = yes @@ -31,4 +31,4 @@ HLC_OPTIONS := $(HLC_NONE) $(HLC_CIRQUE_TRACKPAD) $(HLC_ENCODER) $(HLC_TFT_DISPL ifeq ($(filter 1, $(HLC_OPTIONS)), ) $(error Wrong or no module specified. Please specify one of the following: HLC_NONE, HLC_CIRQUE_TRACKPAD, HLC_ENCODER or HLC_TFT_DISPLAY.) -endif \ No newline at end of file +endif