diff options
| author | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-11-28 12:02:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-28 12:02:18 -0800 |
| commit | c66df1664497546f32662409778731143e45a552 (patch) | |
| tree | da73a2d532a27685a31d932b3a44a707d4a3af81 /tmk_core/common | |
| parent | 15385d4113414d42bd062c60c9de5df797d3157f (diff) | |
| download | qmk_firmware-c66df1664497546f32662409778731143e45a552.tar.gz qmk_firmware-c66df1664497546f32662409778731143e45a552.zip | |
2020 November 28 Breaking Changes Update (#11053)
* Branch point for 2020 November 28 Breaking Change
* Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183)
* Add support for soft serial to ATmega32U2 (#10204)
* Change MIDI velocity implementation to allow direct control of velocity value (#9940)
* Add ability to build a subset of all keyboards based on platform.
* Actually use eeprom_driver_init().
* Make bootloader_jump weak for ChibiOS. (#10417)
* Joystick 16-bit support (#10439)
* Per-encoder resolutions (#10259)
* Share button state from mousekey to pointing_device (#10179)
* Add hotfix for chibios keyboards not wake (#10088)
* Add advanced/efficient RGB Matrix Indicators (#8564)
* Naming change.
* Support for STM32 GPIOF,G,H,I,J,K (#10206)
* Add milc as a dependency and remove the installed milc (#10563)
* ChibiOS upgrade: early init conversions (#10214)
* ChibiOS upgrade: configuration file migrator (#9952)
* Haptic and solenoid cleanup (#9700)
* XD75 cleanup (#10524)
* OLED display update interval support (#10388)
* Add definition based on currently-selected serial driver. (#10716)
* New feature: Retro Tapping per key (#10622)
* Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638)
* Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530)
* Rescale both ChibiOS and AVR backlighting.
* Reduce Helix keyboard build variation (#8669)
* Minor change to behavior allowing display updates to continue between task ticks (#10750)
* Some GPIO manipulations in matrix.c change to atomic. (#10491)
* qmk cformat (#10767)
* [Keyboard] Update the Speedo firmware for v3.0 (#10657)
* Maartenwut/Maarten namechange to evyd13/Evy (#10274)
* [quantum] combine repeated lines of code (#10837)
* Add step sequencer feature (#9703)
* aeboards/ext65 refactor (#10820)
* Refactor xelus/dawn60 for Rev2 later (#10584)
* add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824)
* [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549)
* update chibios os usb for the otg driver (#8893)
* Remove HD44780 References, Part 4 (#10735)
* [Keyboard] Add Valor FRL TKL (+refactor) (#10512)
* Fix cursor position bug in oled_write_raw functions (#10800)
* Fixup version.h writing when using SKIP_VERSION=yes (#10972)
* Allow for certain code in the codebase assuming length of string. (#10974)
* Add AT90USB support for serial.c (#10706)
* Auto shift: support repeats and early registration (#9826)
* Rename ledmatrix.h to match .c file (#7949)
* Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231)
* Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840)
* Merge point for 2020 Nov 28 Breaking Change
Diffstat (limited to 'tmk_core/common')
| -rw-r--r-- | tmk_core/common/action.c | 66 | ||||
| -rw-r--r-- | tmk_core/common/action_util.c | 31 | ||||
| -rw-r--r-- | tmk_core/common/action_util.h | 7 | ||||
| -rw-r--r-- | tmk_core/common/arm_atsam/suspend.c | 2 | ||||
| -rw-r--r-- | tmk_core/common/chibios/bootloader.c | 10 | ||||
| -rw-r--r-- | tmk_core/common/eeconfig.c | 13 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 21 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.h | 3 | ||||
| -rw-r--r-- | tmk_core/common/matrix.h | 10 | ||||
| -rw-r--r-- | tmk_core/common/report.h | 4 |
10 files changed, 129 insertions, 38 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index ee9aa0df7..77da0139f 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
| @@ -37,9 +37,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 37 | # include "nodebug.h" | 37 | # include "nodebug.h" |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #ifdef POINTING_DEVICE_ENABLE | ||
| 41 | # include "pointing_device.h" | ||
| 42 | #endif | ||
| 43 | |||
| 40 | int tp_buttons; | 44 | int tp_buttons; |
| 41 | 45 | ||
| 42 | #ifdef RETRO_TAPPING | 46 | #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) |
| 43 | int retro_tapping_counter = 0; | 47 | int retro_tapping_counter = 0; |
| 44 | #endif | 48 | #endif |
| 45 | 49 | ||
| @@ -51,6 +55,10 @@ int retro_tapping_counter = 0; | |||
| 51 | __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { return false; } | 55 | __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { return false; } |
| 52 | #endif | 56 | #endif |
| 53 | 57 | ||
| 58 | #ifdef RETRO_TAPPING_PER_KEY | ||
| 59 | __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { return false; } | ||
| 60 | #endif | ||
| 61 | |||
| 54 | #ifndef TAP_CODE_DELAY | 62 | #ifndef TAP_CODE_DELAY |
| 55 | # define TAP_CODE_DELAY 0 | 63 | # define TAP_CODE_DELAY 0 |
| 56 | #endif | 64 | #endif |
| @@ -67,7 +75,7 @@ void action_exec(keyevent_t event) { | |||
| 67 | dprint("EVENT: "); | 75 | dprint("EVENT: "); |
| 68 | debug_event(event); | 76 | debug_event(event); |
| 69 | dprintln(); | 77 | dprintln(); |
| 70 | #ifdef RETRO_TAPPING | 78 | #if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) |
| 71 | retro_tapping_counter++; | 79 | retro_tapping_counter++; |
| 72 | #endif | 80 | #endif |
| 73 | } | 81 | } |
| @@ -220,6 +228,19 @@ void process_record_handler(keyrecord_t *record) { | |||
| 220 | process_action(record, action); | 228 | process_action(record, action); |
| 221 | } | 229 | } |
| 222 | 230 | ||
| 231 | #if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) | ||
| 232 | void register_button(bool pressed, enum mouse_buttons button) { | ||
| 233 | # ifdef PS2_MOUSE_ENABLE | ||
| 234 | tp_buttons = pressed ? tp_buttons | button : tp_buttons & ~button; | ||
| 235 | # endif | ||
| 236 | # ifdef POINTING_DEVICE_ENABLE | ||
| 237 | report_mouse_t currentReport = pointing_device_get_report(); | ||
| 238 | currentReport.buttons = pressed ? currentReport.buttons | button : currentReport.buttons & ~button; | ||
| 239 | pointing_device_set_report(currentReport); | ||
| 240 | # endif | ||
| 241 | } | ||
| 242 | #endif | ||
| 243 | |||
| 223 | /** \brief Take an action and processes it. | 244 | /** \brief Take an action and processes it. |
| 224 | * | 245 | * |
| 225 | * FIXME: Needs documentation. | 246 | * FIXME: Needs documentation. |
| @@ -404,15 +425,23 @@ void process_action(keyrecord_t *record, action_t action) { | |||
| 404 | if (event.pressed) { | 425 | if (event.pressed) { |
| 405 | mousekey_on(action.key.code); | 426 | mousekey_on(action.key.code); |
| 406 | switch (action.key.code) { | 427 | switch (action.key.code) { |
| 407 | # ifdef PS2_MOUSE_ENABLE | 428 | # if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) |
| 408 | case KC_MS_BTN1: | 429 | case KC_MS_BTN1: |
| 409 | tp_buttons |= (1 << 0); | 430 | register_button(true, MOUSE_BTN1); |
| 410 | break; | 431 | break; |
| 411 | case KC_MS_BTN2: | 432 | case KC_MS_BTN2: |
| 412 | tp_buttons |= (1 << 1); | 433 | register_button(true, MOUSE_BTN2); |
| 413 | break; | 434 | break; |
| 414 | case KC_MS_BTN3: | 435 | case KC_MS_BTN3: |
| 415 | tp_buttons |= (1 << 2); | 436 | register_button(true, MOUSE_BTN3); |
| 437 | break; | ||
| 438 | # endif | ||
| 439 | # ifdef POINTING_DEVICE_ENABLE | ||
| 440 | case KC_MS_BTN4: | ||
| 441 | register_button(true, MOUSE_BTN4); | ||
| 442 | break; | ||
| 443 | case KC_MS_BTN5: | ||
| 444 | register_button(true, MOUSE_BTN5); | ||
| 416 | break; | 445 | break; |
| 417 | # endif | 446 | # endif |
| 418 | default: | 447 | default: |
| @@ -422,15 +451,23 @@ void process_action(keyrecord_t *record, action_t action) { | |||
| 422 | } else { | 451 | } else { |
| 423 | mousekey_off(action.key.code); | 452 | mousekey_off(action.key.code); |
| 424 | switch (action.key.code) { | 453 | switch (action.key.code) { |
| 425 | # ifdef PS2_MOUSE_ENABLE | 454 | # if defined(PS2_MOUSE_ENABLE) || defined(POINTING_DEVICE_ENABLE) |
| 426 | case KC_MS_BTN1: | 455 | case KC_MS_BTN1: |
| 427 | tp_buttons &= ~(1 << 0); | 456 | register_button(false, MOUSE_BTN1); |
| 428 | break; | 457 | break; |
| 429 | case KC_MS_BTN2: | 458 | case KC_MS_BTN2: |
| 430 | tp_buttons &= ~(1 << 1); | 459 | register_button(false, MOUSE_BTN2); |
| 431 | break; | 460 | break; |
| 432 | case KC_MS_BTN3: | 461 | case KC_MS_BTN3: |
| 433 | tp_buttons &= ~(1 << 2); | 462 | register_button(false, MOUSE_BTN3); |
| 463 | break; | ||
| 464 | # endif | ||
| 465 | # ifdef POINTING_DEVICE_ENABLE | ||
| 466 | case KC_MS_BTN4: | ||
| 467 | register_button(false, MOUSE_BTN4); | ||
| 468 | break; | ||
| 469 | case KC_MS_BTN5: | ||
| 470 | register_button(false, MOUSE_BTN5); | ||
| 434 | break; | 471 | break; |
| 435 | # endif | 472 | # endif |
| 436 | default: | 473 | default: |
| @@ -692,20 +729,23 @@ void process_action(keyrecord_t *record, action_t action) { | |||
| 692 | #endif | 729 | #endif |
| 693 | 730 | ||
| 694 | #ifndef NO_ACTION_TAPPING | 731 | #ifndef NO_ACTION_TAPPING |
| 695 | # ifdef RETRO_TAPPING | 732 | # if defined(RETRO_TAPPING) || defined(RETRO_TAPPING_PER_KEY) |
| 696 | if (!is_tap_action(action)) { | 733 | if (!is_tap_action(action)) { |
| 697 | retro_tapping_counter = 0; | 734 | retro_tapping_counter = 0; |
| 698 | } else { | 735 | } else { |
| 699 | if (event.pressed) { | 736 | if (event.pressed) { |
| 700 | if (tap_count > 0) { | 737 | if (tap_count > 0) { |
| 701 | retro_tapping_counter = 0; | 738 | retro_tapping_counter = 0; |
| 702 | } else { | ||
| 703 | } | 739 | } |
| 704 | } else { | 740 | } else { |
| 705 | if (tap_count > 0) { | 741 | if (tap_count > 0) { |
| 706 | retro_tapping_counter = 0; | 742 | retro_tapping_counter = 0; |
| 707 | } else { | 743 | } else { |
| 708 | if (retro_tapping_counter == 2) { | 744 | if ( |
| 745 | # ifdef RETRO_TAPPING_PER_KEY | ||
| 746 | get_retro_tapping(get_event_keycode(record->event, false), record) && | ||
| 747 | # endif | ||
| 748 | retro_tapping_counter == 2) { | ||
| 709 | tap_code(action.layer_tap.code); | 749 | tap_code(action.layer_tap.code); |
| 710 | } | 750 | } |
| 711 | retro_tapping_counter = 0; | 751 | retro_tapping_counter = 0; |
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c index fd0e4409f..000503b08 100644 --- a/tmk_core/common/action_util.c +++ b/tmk_core/common/action_util.c | |||
| @@ -290,6 +290,32 @@ void set_macro_mods(uint8_t mods) { macro_mods = mods; } | |||
| 290 | void clear_macro_mods(void) { macro_mods = 0; } | 290 | void clear_macro_mods(void) { macro_mods = 0; } |
| 291 | 291 | ||
| 292 | #ifndef NO_ACTION_ONESHOT | 292 | #ifndef NO_ACTION_ONESHOT |
| 293 | /** \brief get oneshot mods | ||
| 294 | * | ||
| 295 | * FIXME: needs doc | ||
| 296 | */ | ||
| 297 | uint8_t get_oneshot_mods(void) { return oneshot_mods; } | ||
| 298 | |||
| 299 | void add_oneshot_mods(uint8_t mods) { | ||
| 300 | if ((oneshot_mods & mods) != mods) { | ||
| 301 | # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | ||
| 302 | oneshot_time = timer_read(); | ||
| 303 | # endif | ||
| 304 | oneshot_mods |= mods; | ||
| 305 | oneshot_mods_changed_kb(mods); | ||
| 306 | } | ||
| 307 | } | ||
| 308 | |||
| 309 | void del_oneshot_mods(uint8_t mods) { | ||
| 310 | if (oneshot_mods & mods) { | ||
| 311 | oneshot_mods &= ~mods; | ||
| 312 | # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | ||
| 313 | oneshot_time = oneshot_mods ? timer_read() : 0; | ||
| 314 | # endif | ||
| 315 | oneshot_mods_changed_kb(oneshot_mods); | ||
| 316 | } | ||
| 317 | } | ||
| 318 | |||
| 293 | /** \brief set oneshot mods | 319 | /** \brief set oneshot mods |
| 294 | * | 320 | * |
| 295 | * FIXME: needs doc | 321 | * FIXME: needs doc |
| @@ -316,11 +342,6 @@ void clear_oneshot_mods(void) { | |||
| 316 | oneshot_mods_changed_kb(oneshot_mods); | 342 | oneshot_mods_changed_kb(oneshot_mods); |
| 317 | } | 343 | } |
| 318 | } | 344 | } |
| 319 | /** \brief get oneshot mods | ||
| 320 | * | ||
| 321 | * FIXME: needs doc | ||
| 322 | */ | ||
| 323 | uint8_t get_oneshot_mods(void) { return oneshot_mods; } | ||
| 324 | #endif | 345 | #endif |
| 325 | 346 | ||
| 326 | /** \brief Called when the one shot modifiers have been changed. | 347 | /** \brief Called when the one shot modifiers have been changed. |
diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h index 5dd8393da..743ff1406 100644 --- a/tmk_core/common/action_util.h +++ b/tmk_core/common/action_util.h | |||
| @@ -57,12 +57,11 @@ void set_macro_mods(uint8_t mods); | |||
| 57 | void clear_macro_mods(void); | 57 | void clear_macro_mods(void); |
| 58 | 58 | ||
| 59 | /* oneshot modifier */ | 59 | /* oneshot modifier */ |
| 60 | void set_oneshot_mods(uint8_t mods); | ||
| 61 | uint8_t get_oneshot_mods(void); | 60 | uint8_t get_oneshot_mods(void); |
| 61 | void add_oneshot_mods(uint8_t mods); | ||
| 62 | void del_oneshot_mods(uint8_t mods); | ||
| 63 | void set_oneshot_mods(uint8_t mods); | ||
| 62 | void clear_oneshot_mods(void); | 64 | void clear_oneshot_mods(void); |
| 63 | void oneshot_toggle(void); | ||
| 64 | void oneshot_enable(void); | ||
| 65 | void oneshot_disable(void); | ||
| 66 | bool has_oneshot_mods_timed_out(void); | 65 | bool has_oneshot_mods_timed_out(void); |
| 67 | 66 | ||
| 68 | uint8_t get_oneshot_locked_mods(void); | 67 | uint8_t get_oneshot_locked_mods(void); |
diff --git a/tmk_core/common/arm_atsam/suspend.c b/tmk_core/common/arm_atsam/suspend.c index d1077be4c..e51426128 100644 --- a/tmk_core/common/arm_atsam/suspend.c +++ b/tmk_core/common/arm_atsam/suspend.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "matrix.h" | 1 | #include "matrix.h" |
| 2 | #include "i2c_master.h" | 2 | #include "i2c_master.h" |
| 3 | #include "led_matrix.h" | 3 | #include "md_rgb_matrix.h" |
| 4 | #include "suspend.h" | 4 | #include "suspend.h" |
| 5 | 5 | ||
| 6 | /** \brief Suspend idle | 6 | /** \brief Suspend idle |
diff --git a/tmk_core/common/chibios/bootloader.c b/tmk_core/common/chibios/bootloader.c index 7b2cf5c43..f6d016ec9 100644 --- a/tmk_core/common/chibios/bootloader.c +++ b/tmk_core/common/chibios/bootloader.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | extern uint32_t __ram0_end__; | 33 | extern uint32_t __ram0_end__; |
| 34 | 34 | ||
| 35 | void bootloader_jump(void) { | 35 | __attribute__((weak)) void bootloader_jump(void) { |
| 36 | // For STM32 MCUs with dual-bank flash, and we're incapable of jumping to the bootloader. The first valid flash | 36 | // For STM32 MCUs with dual-bank flash, and we're incapable of jumping to the bootloader. The first valid flash |
| 37 | // bank is executed unconditionally after a reset, so it doesn't enter DFU unless BOOT0 is high. Instead, we do | 37 | // bank is executed unconditionally after a reset, so it doesn't enter DFU unless BOOT0 is high. Instead, we do |
| 38 | // it with hardware...in this case, we pull a GPIO high/low depending on the configuration, connects 3.3V to | 38 | // it with hardware...in this case, we pull a GPIO high/low depending on the configuration, connects 3.3V to |
| @@ -58,7 +58,7 @@ void enter_bootloader_mode_if_requested(void) {} // not needed at all, but if a | |||
| 58 | 58 | ||
| 59 | extern uint32_t __ram0_end__; | 59 | extern uint32_t __ram0_end__; |
| 60 | 60 | ||
| 61 | void bootloader_jump(void) { | 61 | __attribute__((weak)) void bootloader_jump(void) { |
| 62 | *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader | 62 | *MAGIC_ADDR = BOOTLOADER_MAGIC; // set magic flag => reset handler will jump into boot loader |
| 63 | NVIC_SystemReset(); | 63 | NVIC_SystemReset(); |
| 64 | } | 64 | } |
| @@ -85,8 +85,8 @@ void enter_bootloader_mode_if_requested(void) { | |||
| 85 | # if defined(BOOTLOADER_KIIBOHD) | 85 | # if defined(BOOTLOADER_KIIBOHD) |
| 86 | /* Kiibohd Bootloader (MCHCK and Infinity KB) */ | 86 | /* Kiibohd Bootloader (MCHCK and Infinity KB) */ |
| 87 | # define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 | 87 | # define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 |
| 88 | const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; | 88 | const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; |
| 89 | void bootloader_jump(void) { | 89 | __attribute__((weak)) void bootloader_jump(void) { |
| 90 | __builtin_memcpy((void *)VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); | 90 | __builtin_memcpy((void *)VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic)); |
| 91 | // request reset | 91 | // request reset |
| 92 | SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; | 92 | SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; |
| @@ -95,7 +95,7 @@ void bootloader_jump(void) { | |||
| 95 | # else /* defined(BOOTLOADER_KIIBOHD) */ | 95 | # else /* defined(BOOTLOADER_KIIBOHD) */ |
| 96 | /* Default for Kinetis - expecting an ARM Teensy */ | 96 | /* Default for Kinetis - expecting an ARM Teensy */ |
| 97 | # include "wait.h" | 97 | # include "wait.h" |
| 98 | void bootloader_jump(void) { | 98 | __attribute__((weak)) void bootloader_jump(void) { |
| 99 | wait_ms(100); | 99 | wait_ms(100); |
| 100 | __BKPT(0); | 100 | __BKPT(0); |
| 101 | } | 101 | } |
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index fe56c57d1..e15897552 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c | |||
| @@ -13,6 +13,10 @@ | |||
| 13 | # include "eeprom_driver.h" | 13 | # include "eeprom_driver.h" |
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | #if defined(HAPTIC_ENABLE) | ||
| 17 | # include "haptic.h" | ||
| 18 | #endif | ||
| 19 | |||
| 16 | /** \brief eeconfig enable | 20 | /** \brief eeconfig enable |
| 17 | * | 21 | * |
| 18 | * FIXME: needs doc | 22 | * FIXME: needs doc |
| @@ -65,6 +69,15 @@ void eeconfig_init_quantum(void) { | |||
| 65 | eeprom_update_byte(EECONFIG_HANDEDNESS, 0); | 69 | eeprom_update_byte(EECONFIG_HANDEDNESS, 0); |
| 66 | #endif | 70 | #endif |
| 67 | 71 | ||
| 72 | #if defined(HAPTIC_ENABLE) | ||
| 73 | haptic_reset(); | ||
| 74 | #else | ||
| 75 | // this is used in case haptic is disabled, but we still want sane defaults | ||
| 76 | // in the haptic configuration eeprom. All zero will trigger a haptic_reset | ||
| 77 | // when a haptic-enabled firmware is loaded onto the keyboard. | ||
| 78 | eeprom_update_dword(EECONFIG_HAPTIC, 0); | ||
| 79 | #endif | ||
| 80 | |||
| 68 | eeconfig_init_kb(); | 81 | eeconfig_init_kb(); |
| 69 | } | 82 | } |
| 70 | 83 | ||
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index b0394af00..8c7bdc8b5 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -235,6 +235,20 @@ __attribute__((weak)) bool is_keyboard_left(void) { return true; } | |||
| 235 | */ | 235 | */ |
| 236 | __attribute__((weak)) bool should_process_keypress(void) { return is_keyboard_master(); } | 236 | __attribute__((weak)) bool should_process_keypress(void) { return is_keyboard_master(); } |
| 237 | 237 | ||
| 238 | /** \brief housekeeping_task_kb | ||
| 239 | * | ||
| 240 | * Override this function if you have a need to execute code for every keyboard main loop iteration. | ||
| 241 | * This is specific to keyboard-level functionality. | ||
| 242 | */ | ||
| 243 | __attribute__((weak)) void housekeeping_task_kb(void) {} | ||
| 244 | |||
| 245 | /** \brief housekeeping_task_user | ||
| 246 | * | ||
| 247 | * Override this function if you have a need to execute code for every keyboard main loop iteration. | ||
| 248 | * This is specific to user/keymap-level functionality. | ||
| 249 | */ | ||
| 250 | __attribute__((weak)) void housekeeping_task_user(void) {} | ||
| 251 | |||
| 238 | /** \brief keyboard_init | 252 | /** \brief keyboard_init |
| 239 | * | 253 | * |
| 240 | * FIXME: needs doc | 254 | * FIXME: needs doc |
| @@ -291,6 +305,10 @@ void keyboard_init(void) { | |||
| 291 | dip_switch_init(); | 305 | dip_switch_init(); |
| 292 | #endif | 306 | #endif |
| 293 | 307 | ||
| 308 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) | ||
| 309 | debug_enable = true; | ||
| 310 | #endif | ||
| 311 | |||
| 294 | keyboard_post_init_kb(); /* Always keep this last */ | 312 | keyboard_post_init_kb(); /* Always keep this last */ |
| 295 | } | 313 | } |
| 296 | 314 | ||
| @@ -315,6 +333,9 @@ void keyboard_task(void) { | |||
| 315 | uint8_t keys_processed = 0; | 333 | uint8_t keys_processed = 0; |
| 316 | #endif | 334 | #endif |
| 317 | 335 | ||
| 336 | housekeeping_task_kb(); | ||
| 337 | housekeeping_task_user(); | ||
| 338 | |||
| 318 | #if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT) | 339 | #if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT) |
| 319 | uint8_t ret = matrix_scan(); | 340 | uint8_t ret = matrix_scan(); |
| 320 | #else | 341 | #else |
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index 79d949089..caa18e7e7 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h | |||
| @@ -71,6 +71,9 @@ void keyboard_pre_init_user(void); | |||
| 71 | void keyboard_post_init_kb(void); | 71 | void keyboard_post_init_kb(void); |
| 72 | void keyboard_post_init_user(void); | 72 | void keyboard_post_init_user(void); |
| 73 | 73 | ||
| 74 | void housekeeping_task_kb(void); | ||
| 75 | void housekeeping_task_user(void); | ||
| 76 | |||
| 74 | #ifdef __cplusplus | 77 | #ifdef __cplusplus |
| 75 | } | 78 | } |
| 76 | #endif | 79 | #endif |
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 78506059e..31ec84430 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h | |||
| @@ -30,16 +30,6 @@ typedef uint32_t matrix_row_t; | |||
| 30 | # error "MATRIX_COLS: invalid value" | 30 | # error "MATRIX_COLS: invalid value" |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | #if (MATRIX_ROWS <= 8) | ||
| 34 | typedef uint8_t matrix_col_t; | ||
| 35 | #elif (MATRIX_ROWS <= 16) | ||
| 36 | typedef uint16_t matrix_col_t; | ||
| 37 | #elif (MATRIX_ROWS <= 32) | ||
| 38 | typedef uint32_t matrix_col_t; | ||
| 39 | #else | ||
| 40 | # error "MATRIX_ROWS: invalid value" | ||
| 41 | #endif | ||
| 42 | |||
| 43 | #define MATRIX_ROW_SHIFTER ((matrix_row_t)1) | 33 | #define MATRIX_ROW_SHIFTER ((matrix_row_t)1) |
| 44 | 34 | ||
| 45 | #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1 << col)) | 35 | #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1 << col)) |
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 1aa33c998..610addf43 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h | |||
| @@ -192,7 +192,11 @@ typedef struct { | |||
| 192 | 192 | ||
| 193 | typedef struct { | 193 | typedef struct { |
| 194 | #if JOYSTICK_AXES_COUNT > 0 | 194 | #if JOYSTICK_AXES_COUNT > 0 |
| 195 | # if JOYSTICK_AXES_RESOLUTION > 8 | ||
| 196 | int16_t axes[JOYSTICK_AXES_COUNT]; | ||
| 197 | # else | ||
| 195 | int8_t axes[JOYSTICK_AXES_COUNT]; | 198 | int8_t axes[JOYSTICK_AXES_COUNT]; |
| 199 | # endif | ||
| 196 | #endif | 200 | #endif |
| 197 | 201 | ||
| 198 | #if JOYSTICK_BUTTON_COUNT > 0 | 202 | #if JOYSTICK_BUTTON_COUNT > 0 |
