Skip to content

Commit

Permalink
Refactor use of matrix_scan_kb (qmk#24200)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Jul 27, 2024
1 parent 20ae67b commit 02b43b4
Show file tree
Hide file tree
Showing 24 changed files with 20 additions and 164 deletions.
4 changes: 1 addition & 3 deletions keyboards/capsunlocked/cu75/cu75.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ void matrix_init_kb(void)
#endif
}

void matrix_scan_kb(void)
{
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif
matrix_scan_user();
}

void click(uint16_t freq, uint16_t duration){
Expand Down
4 changes: 1 addition & 3 deletions keyboards/clueboard/2x1800/2019/2019.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ uint8_t detected_shakes = 0;
static uint16_t shake_timer;
#endif

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
#ifdef SHAKE_ENABLE
// Read the current state of the tilt sensor. It is physically
// impossible for both pins to register a low state at the same time.
Expand All @@ -81,8 +81,6 @@ void matrix_scan_kb(void) {
detected_shakes = 0;
}
#endif

matrix_scan_user();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
Expand Down
4 changes: 1 addition & 3 deletions keyboards/clueboard/2x1800/2021/2021.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
#ifndef DRAWING_TOY_MODE
static uint16_t led_frame_timer = 0;

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
if (timer_elapsed(led_frame_timer) > 100) {
max7219_message_sign_task(true);
led_frame_timer = timer_read();
}

matrix_scan_user();
}
#endif

Expand Down
3 changes: 1 addition & 2 deletions keyboards/custommk/evo70/evo70.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
}


void matrix_scan_kb(void) {
matrix_scan_user();
void housekeeping_task_kb(void) {
led_t current_led_state = host_keyboard_led_state();
uint8_t current_layer = get_highest_layer(layer_state);
if (startup_delay) {
Expand Down
3 changes: 1 addition & 2 deletions keyboards/fallacy/fallacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ void matrix_init_kb(void) {
matrix_init_user();
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
update_fallacy_leds();
matrix_scan_user();
}

/* update LED driver with usb led_state
Expand Down
26 changes: 0 additions & 26 deletions keyboards/gboards/butterstick/butterstick.c

This file was deleted.

4 changes: 1 addition & 3 deletions keyboards/handwired/promethium/promethium.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ __attribute__ ((weak))
void battery_poll(uint8_t level) {
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
static uint16_t counter = BATTERY_POLL;
counter++;

if (counter > BATTERY_POLL) {
counter = 0;
battery_poll(battery_level());
}

matrix_scan_user();
}
11 changes: 3 additions & 8 deletions keyboards/hotdox76v2/hotdox76v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return true;
}

void matrix_scan_kb(void) {
if (!is_oled_on()) {
m2s.cur_alp_index = 1;
}
matrix_scan_user();
}

void user_sync_alpa_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) {
const master_to_slave_t *m2s_p = (const master_to_slave_t *)in_data;
s2m.cur_alp_index = m2s_p->cur_alp_index;
Expand All @@ -270,6 +263,9 @@ void keyboard_post_init_kb(void) {

void housekeeping_task_kb(void) {
if (is_keyboard_master()) {
if (!is_oled_on()) {
m2s.cur_alp_index = 1;
}
// Interact with slave every 200ms
static uint32_t last_sync = 0;
if (timer_elapsed32(last_sync) > 200) {
Expand All @@ -281,7 +277,6 @@ void housekeeping_task_kb(void) {
}
}
}
housekeeping_task_user();
}

#endif
Expand Down
3 changes: 0 additions & 3 deletions keyboards/jones/v03/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
void matrix_init_custom(void) {
// initialize key pins
init_pins();

matrix_init_kb();
}

bool matrix_scan_custom(matrix_row_t current_matrix[]) {
Expand All @@ -91,6 +89,5 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
changed |= read_cols_on_row(current_matrix, current_row);
}

matrix_scan_kb();
return changed;
}
3 changes: 0 additions & 3 deletions keyboards/jones/v03_1/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
void matrix_init_custom(void) {
// initialize key pins
init_pins();

matrix_init_kb();
}

bool matrix_scan_custom(matrix_row_t current_matrix[]) {
Expand All @@ -91,6 +89,5 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
changed |= read_cols_on_row(current_matrix, current_row);
}

matrix_scan_kb();
return changed;
}
4 changes: 1 addition & 3 deletions keyboards/lfkeyboards/lfk78/lfk78.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ void matrix_init_kb(void) {
#endif
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif

matrix_scan_user();
}

void clicking_notes(uint16_t freq, uint16_t duration) {
Expand Down
4 changes: 1 addition & 3 deletions keyboards/lfkeyboards/lfk87/lfk87.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ void matrix_init_kb(void)
#endif
}

void matrix_scan_kb(void)
{
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif
matrix_scan_user();
}

void clicking_notes(uint16_t freq, uint16_t duration){
Expand Down
4 changes: 1 addition & 3 deletions keyboards/lfkeyboards/lfkpad/lfkpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ void matrix_init_kb(void) {
#endif
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif

matrix_scan_user();
}
4 changes: 1 addition & 3 deletions keyboards/lfkeyboards/mini1800/mini1800.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ void matrix_init_kb(void)
#endif
}

void matrix_scan_kb(void)
{
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif
matrix_scan_user();
}

void click(uint16_t freq, uint16_t duration){
Expand Down
4 changes: 1 addition & 3 deletions keyboards/lfkeyboards/smk65/revb/revb.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ void matrix_init_kb(void)
#endif
}

void matrix_scan_kb(void)
{
void housekeeping_task_kb(void) {
#ifdef WATCHDOG_ENABLE
wdt_reset();
#endif
matrix_scan_user();
}

void click(uint16_t freq, uint16_t duration){
Expand Down
3 changes: 1 addition & 2 deletions keyboards/makeymakey/makeymakey.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ void cycle_leds(void) {
}
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
cycle_leds();
matrix_scan_user();
}

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
Expand Down
3 changes: 1 addition & 2 deletions keyboards/matrix/m20add/m20add.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ void matrix_init_kb(void) {
matrix_init_user();
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgb_ring_task();
#endif
matrix_scan_user();
}

static uint16_t caps_lock_pin = DEF_PIN(TCA6424_PORT2, 3);
Expand Down
3 changes: 1 addition & 2 deletions keyboards/mlego/m65/m65.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ bool oled_task_kb(void) {

#endif

void matrix_scan_kb(void) {
matrix_scan_user();
void housekeeping_task_kb(void) {
toggle_leds(toggle_lwr, toggle_rse);
}

Expand Down
4 changes: 1 addition & 3 deletions keyboards/owlab/spring/spring.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,14 @@ void set_caps_mode(uint8_t mode){
}


void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
if(caps_in){
if(timer_elapsed32(caps_timer) > 3000){
rgblight_sethsv(pre_rgb.hue, pre_rgb.sat, pre_rgb.val);
rgblight_mode(pre_rgb.mode);
caps_in = false;
}
}

matrix_scan_user();
}


Expand Down
4 changes: 1 addition & 3 deletions keyboards/system76/launch_1/launch_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ void matrix_init_kb(void) {
matrix_init_user();
}

void matrix_scan_kb(void) {
void housekeeping_task_kb(void) {
usb_mux_event();

matrix_scan_user();
}

#define LEVEL(value) (uint8_t)(((uint16_t)value) * ((uint16_t)RGB_MATRIX_MAXIMUM_BRIGHTNESS) / ((uint16_t)255))
Expand Down
26 changes: 0 additions & 26 deletions keyboards/woodkeys/bigseries/1key/1key.c

This file was deleted.

26 changes: 0 additions & 26 deletions keyboards/woodkeys/bigseries/2key/2key.c

This file was deleted.

26 changes: 0 additions & 26 deletions keyboards/woodkeys/bigseries/3key/3key.c

This file was deleted.

Loading

0 comments on commit 02b43b4

Please sign in to comment.