Merge remote-tracking branch 'qmk/master' into merge-2023-03-12
This commit is contained in:
@ -66,9 +66,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef JOYSTICK_ENABLE
|
||||
# include "process_joystick.h"
|
||||
#endif
|
||||
#ifdef PROGRAMMABLE_BUTTON_ENABLE
|
||||
# include "programmable_button.h"
|
||||
#endif
|
||||
#ifdef HD44780_ENABLE
|
||||
# include "hd44780.h"
|
||||
#endif
|
||||
@ -99,9 +96,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#if defined(CRC_ENABLE)
|
||||
# include "crc.h"
|
||||
#endif
|
||||
#ifdef DIGITIZER_ENABLE
|
||||
# include "digitizer.h"
|
||||
#endif
|
||||
#ifdef VIRTSER_ENABLE
|
||||
# include "virtser.h"
|
||||
#endif
|
||||
@ -112,11 +106,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# include "split_util.h"
|
||||
#endif
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
# include "outputselect.h"
|
||||
# include "bluetooth.h"
|
||||
#endif
|
||||
#ifdef CAPS_WORD_ENABLE
|
||||
# include "caps_word.h"
|
||||
#endif
|
||||
#ifdef LEADER_ENABLE
|
||||
# include "leader.h"
|
||||
#endif
|
||||
|
||||
static uint32_t last_input_modification_time = 0;
|
||||
uint32_t last_input_activity_time(void) {
|
||||
@ -176,12 +173,11 @@ uint32_t get_matrix_scan_rate(void) {
|
||||
#endif
|
||||
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
|
||||
static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata) {
|
||||
static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata) {
|
||||
matrix_row_t out = 0;
|
||||
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
|
||||
// read each key in the row data and check if the keymap defines it as a real key
|
||||
if (pgm_read_byte(&keymaps[0][row][col]) && (rowdata & (1 << col))) {
|
||||
if (keycode_at_keymap_location(0, row, col) && (rowdata & (1 << col))) {
|
||||
// this creates new row data, if a key is defined in the keymap, it will be set here
|
||||
out |= 1 << col;
|
||||
}
|
||||
@ -251,7 +247,7 @@ __attribute__((weak)) void keyboard_pre_init_kb(void) {
|
||||
* FIXME: needs doc
|
||||
*/
|
||||
|
||||
__attribute__((weak)) void keyboard_post_init_user() {}
|
||||
__attribute__((weak)) void keyboard_post_init_user(void) {}
|
||||
|
||||
/** \brief keyboard_post_init_kb
|
||||
*
|
||||
@ -262,6 +258,14 @@ __attribute__((weak)) void keyboard_post_init_kb(void) {
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
/** \brief matrix_can_read
|
||||
*
|
||||
* Allows overriding when matrix scanning operations should be executed.
|
||||
*/
|
||||
__attribute__((weak)) bool matrix_can_read(void) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** \brief keyboard_setup
|
||||
*
|
||||
* FIXME: needs doc
|
||||
@ -358,9 +362,6 @@ void quantum_init(void) {
|
||||
#ifdef HAPTIC_ENABLE
|
||||
haptic_init();
|
||||
#endif
|
||||
#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE)
|
||||
set_output(OUTPUT_AUTO);
|
||||
#endif
|
||||
}
|
||||
|
||||
/** \brief keyboard_init
|
||||
@ -375,6 +376,9 @@ void keyboard_init(void) {
|
||||
#endif
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
split_pre_init();
|
||||
#endif
|
||||
#ifdef ENCODER_ENABLE
|
||||
encoder_init();
|
||||
#endif
|
||||
matrix_init();
|
||||
quantum_init();
|
||||
@ -396,9 +400,6 @@ void keyboard_init(void) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_init();
|
||||
#endif
|
||||
#ifdef ENCODER_ENABLE
|
||||
encoder_init();
|
||||
#endif
|
||||
#ifdef STENO_ENABLE_ALL
|
||||
steno_init();
|
||||
#endif
|
||||
@ -422,6 +423,9 @@ void keyboard_init(void) {
|
||||
// init after split init
|
||||
pointing_device_init();
|
||||
#endif
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
bluetooth_init();
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE)
|
||||
debug_enable = true;
|
||||
@ -465,10 +469,14 @@ static inline void generate_tick_event(void) {
|
||||
* @return false Matrix didn't change
|
||||
*/
|
||||
static bool matrix_task(void) {
|
||||
if (!matrix_can_read()) {
|
||||
generate_tick_event();
|
||||
return false;
|
||||
}
|
||||
|
||||
static matrix_row_t matrix_previous[MATRIX_ROWS];
|
||||
|
||||
matrix_scan();
|
||||
|
||||
bool matrix_changed = false;
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS && !matrix_changed; row++) {
|
||||
matrix_changed |= matrix_previous[row] ^ matrix_get_row(row);
|
||||
@ -565,6 +573,10 @@ void quantum_task(void) {
|
||||
combo_task();
|
||||
#endif
|
||||
|
||||
#ifdef LEADER_ENABLE
|
||||
leader_task();
|
||||
#endif
|
||||
|
||||
#ifdef WPM_ENABLE
|
||||
decay_wpm();
|
||||
#endif
|
||||
@ -599,6 +611,10 @@ void keyboard_task(void) {
|
||||
|
||||
quantum_task();
|
||||
|
||||
#if defined(SPLIT_WATCHDOG_ENABLE)
|
||||
split_watchdog_task();
|
||||
#endif
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
rgblight_task();
|
||||
#endif
|
||||
@ -674,12 +690,8 @@ void keyboard_task(void) {
|
||||
joystick_task();
|
||||
#endif
|
||||
|
||||
#ifdef DIGITIZER_ENABLE
|
||||
digitizer_task();
|
||||
#endif
|
||||
|
||||
#ifdef PROGRAMMABLE_BUTTON_ENABLE
|
||||
programmable_button_send();
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
bluetooth_task();
|
||||
#endif
|
||||
|
||||
led_task();
|
||||
|
Reference in New Issue
Block a user