diff options
Diffstat (limited to 'quantum/keyboard.c')
| -rw-r--r-- | quantum/keyboard.c | 70 |
1 files changed, 19 insertions, 51 deletions
diff --git a/quantum/keyboard.c b/quantum/keyboard.c index b98fc64e4..3bca05aab 100644 --- a/quantum/keyboard.c +++ b/quantum/keyboard.c | |||
| @@ -40,12 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 40 | #ifdef PS2_MOUSE_ENABLE | 40 | #ifdef PS2_MOUSE_ENABLE |
| 41 | # include "ps2_mouse.h" | 41 | # include "ps2_mouse.h" |
| 42 | #endif | 42 | #endif |
| 43 | #ifdef SERIAL_MOUSE_ENABLE | ||
| 44 | # include "serial_mouse.h" | ||
| 45 | #endif | ||
| 46 | #ifdef ADB_MOUSE_ENABLE | ||
| 47 | # include "adb.h" | ||
| 48 | #endif | ||
| 49 | #ifdef RGBLIGHT_ENABLE | 43 | #ifdef RGBLIGHT_ENABLE |
| 50 | # include "rgblight.h" | 44 | # include "rgblight.h" |
| 51 | #endif | 45 | #endif |
| @@ -61,12 +55,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 61 | #ifdef STENO_ENABLE | 55 | #ifdef STENO_ENABLE |
| 62 | # include "process_steno.h" | 56 | # include "process_steno.h" |
| 63 | #endif | 57 | #endif |
| 64 | #ifdef SERIAL_LINK_ENABLE | ||
| 65 | # include "serial_link/system/serial_link.h" | ||
| 66 | #endif | ||
| 67 | #ifdef VISUALIZER_ENABLE | ||
| 68 | # include "visualizer/visualizer.h" | ||
| 69 | #endif | ||
| 70 | #ifdef POINTING_DEVICE_ENABLE | 58 | #ifdef POINTING_DEVICE_ENABLE |
| 71 | # include "pointing_device.h" | 59 | # include "pointing_device.h" |
| 72 | #endif | 60 | #endif |
| @@ -76,12 +64,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 76 | #ifdef JOYSTICK_ENABLE | 64 | #ifdef JOYSTICK_ENABLE |
| 77 | # include "process_joystick.h" | 65 | # include "process_joystick.h" |
| 78 | #endif | 66 | #endif |
| 67 | #ifdef PROGRAMMABLE_BUTTON_ENABLE | ||
| 68 | # include "programmable_button.h" | ||
| 69 | #endif | ||
| 79 | #ifdef HD44780_ENABLE | 70 | #ifdef HD44780_ENABLE |
| 80 | # include "hd44780.h" | 71 | # include "hd44780.h" |
| 81 | #endif | 72 | #endif |
| 82 | #ifdef QWIIC_ENABLE | ||
| 83 | # include "qwiic.h" | ||
| 84 | #endif | ||
| 85 | #ifdef OLED_ENABLE | 73 | #ifdef OLED_ENABLE |
| 86 | # include "oled_driver.h" | 74 | # include "oled_driver.h" |
| 87 | #endif | 75 | #endif |
| @@ -97,9 +85,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 97 | #ifdef DIP_SWITCH_ENABLE | 85 | #ifdef DIP_SWITCH_ENABLE |
| 98 | # include "dip_switch.h" | 86 | # include "dip_switch.h" |
| 99 | #endif | 87 | #endif |
| 100 | #ifdef STM32_EEPROM_ENABLE | ||
| 101 | # include "eeprom_stm32.h" | ||
| 102 | #endif | ||
| 103 | #ifdef EEPROM_DRIVER | 88 | #ifdef EEPROM_DRIVER |
| 104 | # include "eeprom_driver.h" | 89 | # include "eeprom_driver.h" |
| 105 | #endif | 90 | #endif |
| @@ -109,6 +94,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 109 | #ifdef DIGITIZER_ENABLE | 94 | #ifdef DIGITIZER_ENABLE |
| 110 | # include "digitizer.h" | 95 | # include "digitizer.h" |
| 111 | #endif | 96 | #endif |
| 97 | #ifdef VIRTSER_ENABLE | ||
| 98 | # include "virtser.h" | ||
| 99 | #endif | ||
| 100 | #ifdef SLEEP_LED_ENABLE | ||
| 101 | # include "sleep_led.h" | ||
| 102 | #endif | ||
| 112 | 103 | ||
| 113 | static uint32_t last_input_modification_time = 0; | 104 | static uint32_t last_input_modification_time = 0; |
| 114 | uint32_t last_input_activity_time(void) { return last_input_modification_time; } | 105 | uint32_t last_input_activity_time(void) { return last_input_modification_time; } |
| @@ -246,9 +237,6 @@ void keyboard_setup(void) { | |||
| 246 | disable_jtag(); | 237 | disable_jtag(); |
| 247 | #endif | 238 | #endif |
| 248 | print_set_sendchar(sendchar); | 239 | print_set_sendchar(sendchar); |
| 249 | #ifdef STM32_EEPROM_ENABLE | ||
| 250 | EEPROM_Init(); | ||
| 251 | #endif | ||
| 252 | #ifdef EEPROM_DRIVER | 240 | #ifdef EEPROM_DRIVER |
| 253 | eeprom_driver_init(); | 241 | eeprom_driver_init(); |
| 254 | #endif | 242 | #endif |
| @@ -316,9 +304,6 @@ void keyboard_init(void) { | |||
| 316 | #if defined(CRC_ENABLE) | 304 | #if defined(CRC_ENABLE) |
| 317 | crc_init(); | 305 | crc_init(); |
| 318 | #endif | 306 | #endif |
| 319 | #ifdef QWIIC_ENABLE | ||
| 320 | qwiic_init(); | ||
| 321 | #endif | ||
| 322 | #ifdef OLED_ENABLE | 307 | #ifdef OLED_ENABLE |
| 323 | oled_init(OLED_ROTATION_0); | 308 | oled_init(OLED_ROTATION_0); |
| 324 | #endif | 309 | #endif |
| @@ -328,12 +313,6 @@ void keyboard_init(void) { | |||
| 328 | #ifdef PS2_MOUSE_ENABLE | 313 | #ifdef PS2_MOUSE_ENABLE |
| 329 | ps2_mouse_init(); | 314 | ps2_mouse_init(); |
| 330 | #endif | 315 | #endif |
| 331 | #ifdef SERIAL_MOUSE_ENABLE | ||
| 332 | serial_mouse_init(); | ||
| 333 | #endif | ||
| 334 | #ifdef ADB_MOUSE_ENABLE | ||
| 335 | adb_mouse_init(); | ||
| 336 | #endif | ||
| 337 | #ifdef BACKLIGHT_ENABLE | 316 | #ifdef BACKLIGHT_ENABLE |
| 338 | backlight_init(); | 317 | backlight_init(); |
| 339 | #endif | 318 | #endif |
| @@ -356,6 +335,12 @@ void keyboard_init(void) { | |||
| 356 | #ifdef DIP_SWITCH_ENABLE | 335 | #ifdef DIP_SWITCH_ENABLE |
| 357 | dip_switch_init(); | 336 | dip_switch_init(); |
| 358 | #endif | 337 | #endif |
| 338 | #ifdef SLEEP_LED_ENABLE | ||
| 339 | sleep_led_init(); | ||
| 340 | #endif | ||
| 341 | #ifdef VIRTSER_ENABLE | ||
| 342 | virtser_init(); | ||
| 343 | #endif | ||
| 359 | 344 | ||
| 360 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) | 345 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) |
| 361 | debug_enable = true; | 346 | debug_enable = true; |
| @@ -384,7 +369,6 @@ void switch_events(uint8_t row, uint8_t col, bool pressed) { | |||
| 384 | * | 369 | * |
| 385 | * * scan matrix | 370 | * * scan matrix |
| 386 | * * handle mouse movements | 371 | * * handle mouse movements |
| 387 | * * run visualizer code | ||
| 388 | * * handle midi commands | 372 | * * handle midi commands |
| 389 | * * light LEDs | 373 | * * light LEDs |
| 390 | * | 374 | * |
| @@ -473,10 +457,6 @@ MATRIX_LOOP_END: | |||
| 473 | if (encoders_changed) last_encoder_activity_trigger(); | 457 | if (encoders_changed) last_encoder_activity_trigger(); |
| 474 | #endif | 458 | #endif |
| 475 | 459 | ||
| 476 | #ifdef QWIIC_ENABLE | ||
| 477 | qwiic_task(); | ||
| 478 | #endif | ||
| 479 | |||
| 480 | #ifdef OLED_ENABLE | 460 | #ifdef OLED_ENABLE |
| 481 | oled_task(); | 461 | oled_task(); |
| 482 | # if OLED_TIMEOUT > 0 | 462 | # if OLED_TIMEOUT > 0 |
| @@ -510,22 +490,6 @@ MATRIX_LOOP_END: | |||
| 510 | ps2_mouse_task(); | 490 | ps2_mouse_task(); |
| 511 | #endif | 491 | #endif |
| 512 | 492 | ||
| 513 | #ifdef SERIAL_MOUSE_ENABLE | ||
| 514 | serial_mouse_task(); | ||
| 515 | #endif | ||
| 516 | |||
| 517 | #ifdef ADB_MOUSE_ENABLE | ||
| 518 | adb_mouse_task(); | ||
| 519 | #endif | ||
| 520 | |||
| 521 | #ifdef SERIAL_LINK_ENABLE | ||
| 522 | serial_link_update(); | ||
| 523 | #endif | ||
| 524 | |||
| 525 | #ifdef VISUALIZER_ENABLE | ||
| 526 | visualizer_update(default_layer_state, layer_state, visualizer_get_mods(), host_keyboard_leds()); | ||
| 527 | #endif | ||
| 528 | |||
| 529 | #ifdef POINTING_DEVICE_ENABLE | 493 | #ifdef POINTING_DEVICE_ENABLE |
| 530 | pointing_device_task(); | 494 | pointing_device_task(); |
| 531 | #endif | 495 | #endif |
| @@ -548,6 +512,10 @@ MATRIX_LOOP_END: | |||
| 548 | digitizer_task(); | 512 | digitizer_task(); |
| 549 | #endif | 513 | #endif |
| 550 | 514 | ||
| 515 | #ifdef PROGRAMMABLE_BUTTON_ENABLE | ||
| 516 | programmable_button_send(); | ||
| 517 | #endif | ||
| 518 | |||
| 551 | // update LED | 519 | // update LED |
| 552 | if (led_status != host_keyboard_leds()) { | 520 | if (led_status != host_keyboard_leds()) { |
| 553 | led_status = host_keyboard_leds(); | 521 | led_status = host_keyboard_leds(); |
