aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/process_keycode/process_combo.c2
-rw-r--r--quantum/process_keycode/process_combo.h2
-rw-r--r--quantum/process_keycode/process_music.c2
-rw-r--r--quantum/process_keycode/process_music.h2
-rw-r--r--quantum/process_keycode/process_tap_dance.c2
-rw-r--r--quantum/process_keycode/process_tap_dance.h2
-rw-r--r--quantum/quantum.c8
-rw-r--r--quantum/quantum.h4
-rw-r--r--quantum/sequencer/sequencer.c2
-rw-r--r--quantum/sequencer/sequencer.h2
-rw-r--r--quantum/sequencer/tests/sequencer_tests.cpp26
11 files changed, 25 insertions, 29 deletions
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index f38d7d47a..9e1629248 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -184,7 +184,7 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
184 return !is_combo_key; 184 return !is_combo_key;
185} 185}
186 186
187void matrix_scan_combo(void) { 187void combo_task(void) {
188 if (b_combo_enable && is_active && timer && timer_elapsed(timer) > COMBO_TERM) { 188 if (b_combo_enable && is_active && timer && timer_elapsed(timer) > COMBO_TERM) {
189 /* This disables the combo, meaning key events for this 189 /* This disables the combo, meaning key events for this
190 * combo will be handled by the next processors in the chain 190 * combo will be handled by the next processors in the chain
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h
index e51a2f1f4..9af97588b 100644
--- a/quantum/process_keycode/process_combo.h
+++ b/quantum/process_keycode/process_combo.h
@@ -54,7 +54,7 @@ typedef struct {
54#endif 54#endif
55 55
56bool process_combo(uint16_t keycode, keyrecord_t *record); 56bool process_combo(uint16_t keycode, keyrecord_t *record);
57void matrix_scan_combo(void); 57void combo_task(void);
58void process_combo_event(uint16_t combo_index, bool pressed); 58void process_combo_event(uint16_t combo_index, bool pressed);
59 59
60void combo_enable(void); 60void combo_enable(void);
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c
index eb06be96c..2beccbd8f 100644
--- a/quantum/process_keycode/process_music.c
+++ b/quantum/process_keycode/process_music.c
@@ -296,7 +296,7 @@ void music_mode_cycle(void) {
296# endif 296# endif
297} 297}
298 298
299void matrix_scan_music(void) { 299void music_task(void) {
300 if (music_sequence_playing) { 300 if (music_sequence_playing) {
301 if ((music_sequence_timer == 0) || (timer_elapsed(music_sequence_timer) > music_sequence_interval)) { 301 if ((music_sequence_timer == 0) || (timer_elapsed(music_sequence_timer) > music_sequence_interval)) {
302 music_sequence_timer = timer_read(); 302 music_sequence_timer = timer_read();
diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h
index 01014aa6c..e275cd9d2 100644
--- a/quantum/process_keycode/process_music.h
+++ b/quantum/process_keycode/process_music.h
@@ -44,7 +44,7 @@ void music_scale_user(void);
44void music_all_notes_off(void); 44void music_all_notes_off(void);
45void music_mode_cycle(void); 45void music_mode_cycle(void);
46 46
47void matrix_scan_music(void); 47void music_task(void);
48 48
49bool music_mask(uint16_t keycode); 49bool music_mask(uint16_t keycode);
50bool music_mask_kb(uint16_t keycode); 50bool music_mask_kb(uint16_t keycode);
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index 17dc540a6..c8712d919 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -161,7 +161,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
161 return true; 161 return true;
162} 162}
163 163
164void matrix_scan_tap_dance() { 164void tap_dance_task() {
165 if (highest_td == -1) return; 165 if (highest_td == -1) return;
166 uint16_t tap_user_defined; 166 uint16_t tap_user_defined;
167 167
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index a013c5cab..d9ffb1e73 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -85,7 +85,7 @@ extern qk_tap_dance_action_t tap_dance_actions[];
85 85
86void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); 86void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record);
87bool process_tap_dance(uint16_t keycode, keyrecord_t *record); 87bool process_tap_dance(uint16_t keycode, keyrecord_t *record);
88void matrix_scan_tap_dance(void); 88void tap_dance_task(void);
89void reset_tap_dance(qk_tap_dance_state_t *state); 89void reset_tap_dance(qk_tap_dance_state_t *state);
90 90
91void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data); 91void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data);
diff --git a/quantum/quantum.c b/quantum/quantum.c
index f430a521b..87b219428 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -411,7 +411,7 @@ void matrix_scan_quantum() {
411#endif 411#endif
412 412
413#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) 413#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
414 matrix_scan_music(); 414 music_task();
415#endif 415#endif
416 416
417#ifdef KEY_OVERRIDE_ENABLE 417#ifdef KEY_OVERRIDE_ENABLE
@@ -419,15 +419,15 @@ void matrix_scan_quantum() {
419#endif 419#endif
420 420
421#ifdef SEQUENCER_ENABLE 421#ifdef SEQUENCER_ENABLE
422 matrix_scan_sequencer(); 422 sequencer_task();
423#endif 423#endif
424 424
425#ifdef TAP_DANCE_ENABLE 425#ifdef TAP_DANCE_ENABLE
426 matrix_scan_tap_dance(); 426 tap_dance_task();
427#endif 427#endif
428 428
429#ifdef COMBO_ENABLE 429#ifdef COMBO_ENABLE
430 matrix_scan_combo(); 430 combo_task();
431#endif 431#endif
432 432
433#ifdef LED_MATRIX_ENABLE 433#ifdef LED_MATRIX_ENABLE
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 72970a649..d44dc26d2 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -212,10 +212,6 @@ void set_single_persistent_default_layer(uint8_t default_layer);
212#define IS_LAYER_ON_STATE(state, layer) layer_state_cmp(state, layer) 212#define IS_LAYER_ON_STATE(state, layer) layer_state_cmp(state, layer)
213#define IS_LAYER_OFF_STATE(state, layer) !layer_state_cmp(state, layer) 213#define IS_LAYER_OFF_STATE(state, layer) !layer_state_cmp(state, layer)
214 214
215void matrix_init_kb(void);
216void matrix_scan_kb(void);
217void matrix_init_user(void);
218void matrix_scan_user(void);
219uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache); 215uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache);
220uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache); 216uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
221bool process_action_kb(keyrecord_t *record); 217bool process_action_kb(keyrecord_t *record);
diff --git a/quantum/sequencer/sequencer.c b/quantum/sequencer/sequencer.c
index 0eaf3a17a..18a83661e 100644
--- a/quantum/sequencer/sequencer.c
+++ b/quantum/sequencer/sequencer.c
@@ -211,7 +211,7 @@ void sequencer_phase_pause(void) {
211 sequencer_internal_state.phase = SEQUENCER_PHASE_ATTACK; 211 sequencer_internal_state.phase = SEQUENCER_PHASE_ATTACK;
212} 212}
213 213
214void matrix_scan_sequencer(void) { 214void sequencer_task(void) {
215 if (!sequencer_config.enabled) { 215 if (!sequencer_config.enabled) {
216 return; 216 return;
217 } 217 }
diff --git a/quantum/sequencer/sequencer.h b/quantum/sequencer/sequencer.h
index aeca7a1e9..4017ae764 100644
--- a/quantum/sequencer/sequencer.h
+++ b/quantum/sequencer/sequencer.h
@@ -119,4 +119,4 @@ uint16_t sequencer_get_step_duration(void);
119uint16_t get_beat_duration(uint8_t tempo); 119uint16_t get_beat_duration(uint8_t tempo);
120uint16_t get_step_duration(uint8_t tempo, sequencer_resolution_t resolution); 120uint16_t get_step_duration(uint8_t tempo, sequencer_resolution_t resolution);
121 121
122void matrix_scan_sequencer(void); 122void sequencer_task(void);
diff --git a/quantum/sequencer/tests/sequencer_tests.cpp b/quantum/sequencer/tests/sequencer_tests.cpp
index e81984e5b..290605a52 100644
--- a/quantum/sequencer/tests/sequencer_tests.cpp
+++ b/quantum/sequencer/tests/sequencer_tests.cpp
@@ -386,7 +386,7 @@ void setUpMatrixScanSequencerTest(void) {
386TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackFirstTrackOfFirstStep) { 386TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackFirstTrackOfFirstStep) {
387 setUpMatrixScanSequencerTest(); 387 setUpMatrixScanSequencerTest();
388 388
389 matrix_scan_sequencer(); 389 sequencer_task();
390 EXPECT_EQ(last_noteon, MI_C); 390 EXPECT_EQ(last_noteon, MI_C);
391 EXPECT_EQ(last_noteoff, 0); 391 EXPECT_EQ(last_noteoff, 0);
392} 392}
@@ -394,7 +394,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackFirstTrackOfFirstStep)
394TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackSecondTrackAfterFirstTrackOfFirstStep) { 394TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackSecondTrackAfterFirstTrackOfFirstStep) {
395 setUpMatrixScanSequencerTest(); 395 setUpMatrixScanSequencerTest();
396 396
397 matrix_scan_sequencer(); 397 sequencer_task();
398 EXPECT_EQ(sequencer_internal_state.current_step, 0); 398 EXPECT_EQ(sequencer_internal_state.current_step, 0);
399 EXPECT_EQ(sequencer_internal_state.current_track, 1); 399 EXPECT_EQ(sequencer_internal_state.current_track, 1);
400 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK); 400 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK);
@@ -409,7 +409,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldNotAttackInactiveTrackFirstSt
409 // Wait some time after the first track has been attacked 409 // Wait some time after the first track has been attacked
410 advance_time(SEQUENCER_TRACK_THROTTLE); 410 advance_time(SEQUENCER_TRACK_THROTTLE);
411 411
412 matrix_scan_sequencer(); 412 sequencer_task();
413 EXPECT_EQ(last_noteon, 0); 413 EXPECT_EQ(last_noteon, 0);
414 EXPECT_EQ(last_noteoff, 0); 414 EXPECT_EQ(last_noteoff, 0);
415} 415}
@@ -423,7 +423,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldAttackThirdTrackAfterSecondTr
423 // Wait some time after the second track has been attacked 423 // Wait some time after the second track has been attacked
424 advance_time(2 * SEQUENCER_TRACK_THROTTLE); 424 advance_time(2 * SEQUENCER_TRACK_THROTTLE);
425 425
426 matrix_scan_sequencer(); 426 sequencer_task();
427 EXPECT_EQ(sequencer_internal_state.current_step, 0); 427 EXPECT_EQ(sequencer_internal_state.current_step, 0);
428 EXPECT_EQ(sequencer_internal_state.current_track, 2); 428 EXPECT_EQ(sequencer_internal_state.current_track, 2);
429 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK); 429 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK);
@@ -438,7 +438,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldEnterReleasePhaseAfterLastTra
438 // Wait until all notes have been attacked 438 // Wait until all notes have been attacked
439 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE); 439 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE);
440 440
441 matrix_scan_sequencer(); 441 sequencer_task();
442 EXPECT_EQ(last_noteon, 0); 442 EXPECT_EQ(last_noteon, 0);
443 EXPECT_EQ(last_noteoff, 0); 443 EXPECT_EQ(last_noteoff, 0);
444 EXPECT_EQ(sequencer_internal_state.current_step, 0); 444 EXPECT_EQ(sequencer_internal_state.current_step, 0);
@@ -458,7 +458,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldReleaseBackwards) {
458 // + the release timeout 458 // + the release timeout
459 advance_time(SEQUENCER_PHASE_RELEASE_TIMEOUT); 459 advance_time(SEQUENCER_PHASE_RELEASE_TIMEOUT);
460 460
461 matrix_scan_sequencer(); 461 sequencer_task();
462 EXPECT_EQ(sequencer_internal_state.current_step, 0); 462 EXPECT_EQ(sequencer_internal_state.current_step, 0);
463 EXPECT_EQ(sequencer_internal_state.current_track, SEQUENCER_TRACKS - 2); 463 EXPECT_EQ(sequencer_internal_state.current_track, SEQUENCER_TRACKS - 2);
464 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_RELEASE); 464 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_RELEASE);
@@ -476,7 +476,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldNotReleaseInactiveTrackFirstS
476 // + the release timeout 476 // + the release timeout
477 advance_time(SEQUENCER_PHASE_RELEASE_TIMEOUT); 477 advance_time(SEQUENCER_PHASE_RELEASE_TIMEOUT);
478 478
479 matrix_scan_sequencer(); 479 sequencer_task();
480 EXPECT_EQ(last_noteon, 0); 480 EXPECT_EQ(last_noteon, 0);
481 EXPECT_EQ(last_noteoff, 0); 481 EXPECT_EQ(last_noteoff, 0);
482} 482}
@@ -495,7 +495,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldReleaseFirstTrackFirstStep) {
495 // + all the other notes have been released 495 // + all the other notes have been released
496 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE); 496 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE);
497 497
498 matrix_scan_sequencer(); 498 sequencer_task();
499 EXPECT_EQ(last_noteon, 0); 499 EXPECT_EQ(last_noteon, 0);
500 EXPECT_EQ(last_noteoff, MI_C); 500 EXPECT_EQ(last_noteoff, MI_C);
501} 501}
@@ -514,7 +514,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldEnterPausePhaseAfterRelease)
514 // + all the other notes have been released 514 // + all the other notes have been released
515 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE); 515 advance_time((SEQUENCER_TRACKS - 1) * SEQUENCER_TRACK_THROTTLE);
516 516
517 matrix_scan_sequencer(); 517 sequencer_task();
518 EXPECT_EQ(sequencer_internal_state.current_step, 0); 518 EXPECT_EQ(sequencer_internal_state.current_step, 0);
519 EXPECT_EQ(sequencer_internal_state.current_track, 0); 519 EXPECT_EQ(sequencer_internal_state.current_track, 0);
520 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_PAUSE); 520 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_PAUSE);
@@ -536,7 +536,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldProcessFirstTrackOfSecondStep
536 // + the step duration (one 16th at tempo=120 lasts 125ms) 536 // + the step duration (one 16th at tempo=120 lasts 125ms)
537 advance_time(125); 537 advance_time(125);
538 538
539 matrix_scan_sequencer(); 539 sequencer_task();
540 EXPECT_EQ(sequencer_internal_state.current_step, 1); 540 EXPECT_EQ(sequencer_internal_state.current_step, 1);
541 EXPECT_EQ(sequencer_internal_state.current_track, 1); 541 EXPECT_EQ(sequencer_internal_state.current_track, 1);
542 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK); 542 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK);
@@ -548,7 +548,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldProcessSecondTrackTooEarly) {
548 sequencer_internal_state.current_step = 2; 548 sequencer_internal_state.current_step = 2;
549 sequencer_internal_state.current_track = 1; 549 sequencer_internal_state.current_track = 1;
550 550
551 matrix_scan_sequencer(); 551 sequencer_task();
552 EXPECT_EQ(last_noteon, 0); 552 EXPECT_EQ(last_noteon, 0);
553 EXPECT_EQ(last_noteoff, 0); 553 EXPECT_EQ(last_noteoff, 0);
554} 554}
@@ -562,7 +562,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldProcessSecondTrackOnTime) {
562 // Wait until first track has been attacked 562 // Wait until first track has been attacked
563 advance_time(SEQUENCER_TRACK_THROTTLE); 563 advance_time(SEQUENCER_TRACK_THROTTLE);
564 564
565 matrix_scan_sequencer(); 565 sequencer_task();
566 EXPECT_EQ(last_noteon, MI_D); 566 EXPECT_EQ(last_noteon, MI_D);
567 EXPECT_EQ(last_noteoff, 0); 567 EXPECT_EQ(last_noteoff, 0);
568} 568}
@@ -583,7 +583,7 @@ TEST_F(SequencerTest, TestMatrixScanSequencerShouldLoopOnceSequenceIsOver) {
583 // + the step duration (one 16th at tempo=120 lasts 125ms) 583 // + the step duration (one 16th at tempo=120 lasts 125ms)
584 advance_time(125); 584 advance_time(125);
585 585
586 matrix_scan_sequencer(); 586 sequencer_task();
587 EXPECT_EQ(sequencer_internal_state.current_step, 0); 587 EXPECT_EQ(sequencer_internal_state.current_step, 0);
588 EXPECT_EQ(sequencer_internal_state.current_track, 1); 588 EXPECT_EQ(sequencer_internal_state.current_track, 1);
589 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK); 589 EXPECT_EQ(sequencer_internal_state.phase, SEQUENCER_PHASE_ATTACK);