Skip to content

Commit ab375d3

Browse files
committed
Revert "Keep track of last matrix activity (#10730)"
This reverts commit 79d1db3.
1 parent 4b44452 commit ab375d3

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

quantum/split_common/matrix.c

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -251,59 +251,48 @@ void matrix_init(void) {
251251
split_post_init();
252252
}
253253

254-
bool matrix_post_scan(void) {
255-
bool changed = false;
254+
void matrix_post_scan(void) {
256255
if (is_keyboard_master()) {
257256
static uint8_t error_count;
258257

259-
matrix_row_t slave_matrix[ROWS_PER_HAND] = {0};
260-
if (!transport_master(slave_matrix)) {
258+
if (!transport_master(matrix + thatHand)) {
261259
error_count++;
262260

263261
if (error_count > ERROR_DISCONNECT_COUNT) {
264262
// reset other half if disconnected
265263
for (int i = 0; i < ROWS_PER_HAND; ++i) {
266-
slave_matrix[i] = 0;
264+
matrix[thatHand + i] = 0;
267265
}
268266
}
269267
} else {
270268
error_count = 0;
271269
}
272270

273-
for (int i = 0; i < ROWS_PER_HAND; ++i) {
274-
if (matrix[thatHand + i] != slave_matrix[i]) {
275-
matrix[thatHand + i] = slave_matrix[i];
276-
changed = true;
277-
}
278-
}
279-
280271
matrix_scan_quantum();
281272
} else {
282273
transport_slave(matrix + thisHand);
283274

284275
matrix_slave_scan_user();
285276
}
286-
287-
return changed;
288277
}
289278

290279
uint8_t matrix_scan(void) {
291-
bool local_changed = false;
280+
bool changed = false;
292281

293282
#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
294283
// Set row, read cols
295284
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
296-
local_changed |= read_cols_on_row(raw_matrix, current_row);
285+
changed |= read_cols_on_row(raw_matrix, current_row);
297286
}
298287
#elif (DIODE_DIRECTION == ROW2COL)
299288
// Set col, read rows
300289
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
301-
local_changed |= read_rows_on_col(raw_matrix, current_col);
290+
changed |= read_rows_on_col(raw_matrix, current_col);
302291
}
303292
#endif
304293

305-
debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, local_changed);
294+
debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed);
306295

307-
bool remote_changed = matrix_post_scan();
308-
return (uint8_t)(local_changed || remote_changed);
296+
matrix_post_scan();
297+
return (uint8_t)changed;
309298
}

tmk_core/common/keyboard.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9797
# include "dip_switch.h"
9898
#endif
9999

100-
static uint32_t last_matrix_modification_time = 0;
101-
uint32_t last_matrix_activity_time(void) { return last_matrix_modification_time; }
102-
uint32_t last_matrix_activity_elapsed(void) { return timer_elapsed32(last_matrix_modification_time); }
103-
104100
// Only enable this if console is enabled to print to
105101
#if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE)
106102
static uint32_t matrix_timer = 0;
@@ -342,8 +338,11 @@ void keyboard_task(void) {
342338
housekeeping_task_kb();
343339
housekeeping_task_user();
344340

345-
uint8_t matrix_changed = matrix_scan();
346-
if (matrix_changed) last_matrix_modification_time = timer_read32();
341+
#if defined(OLED_DRIVER_ENABLE) && !defined(OLED_DISABLE_TIMEOUT)
342+
uint8_t ret = matrix_scan();
343+
#else
344+
matrix_scan();
345+
#endif
347346

348347
if (should_process_keypress()) {
349348
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
@@ -410,7 +409,7 @@ void keyboard_task(void) {
410409
oled_task();
411410
# ifndef OLED_DISABLE_TIMEOUT
412411
// Wake up oled if user is using those fabulous keys!
413-
if (matrix_changed) oled_on();
412+
if (ret) oled_on();
414413
# endif
415414
#endif
416415

tmk_core/common/keyboard.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ void keyboard_post_init_user(void);
7373
void housekeeping_task_kb(void);
7474
void housekeeping_task_user(void);
7575

76-
uint32_t last_matrix_activity_time(void); // Timestamp of the last matrix activity
77-
uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since the last matrix activity
78-
7976
#ifdef __cplusplus
8077
}
8178
#endif

0 commit comments

Comments
 (0)