summaryrefslogtreecommitdiff
path: root/quantum/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/keyboard.c')
-rw-r--r--quantum/keyboard.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/quantum/keyboard.c b/quantum/keyboard.c
index ec2f2e4496..3f030d8845 100644
--- a/quantum/keyboard.c
+++ b/quantum/keyboard.c
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h"
#include "keyboard.h"
#include "matrix.h"
-#include "keymap.h"
+#include "keymap_introspection.h"
#include "magic.h"
#include "host.h"
#include "led.h"
@@ -114,7 +114,7 @@ uint32_t last_input_activity_time(void) {
return last_input_modification_time;
}
uint32_t last_input_activity_elapsed(void) {
- return timer_elapsed32(last_input_modification_time);
+ return sync_timer_elapsed32(last_input_modification_time);
}
static uint32_t last_matrix_modification_time = 0;
@@ -122,10 +122,10 @@ uint32_t last_matrix_activity_time(void) {
return last_matrix_modification_time;
}
uint32_t last_matrix_activity_elapsed(void) {
- return timer_elapsed32(last_matrix_modification_time);
+ return sync_timer_elapsed32(last_matrix_modification_time);
}
void last_matrix_activity_trigger(void) {
- last_matrix_modification_time = last_input_modification_time = timer_read32();
+ last_matrix_modification_time = last_input_modification_time = sync_timer_read32();
}
static uint32_t last_encoder_modification_time = 0;
@@ -133,10 +133,16 @@ uint32_t last_encoder_activity_time(void) {
return last_encoder_modification_time;
}
uint32_t last_encoder_activity_elapsed(void) {
- return timer_elapsed32(last_encoder_modification_time);
+ return sync_timer_elapsed32(last_encoder_modification_time);
}
void last_encoder_activity_trigger(void) {
- last_encoder_modification_time = last_input_modification_time = timer_read32();
+ last_encoder_modification_time = last_input_modification_time = sync_timer_read32();
+}
+
+void set_activity_timestamps(uint32_t matrix_timestamp, uint32_t encoder_timestamp) {
+ last_matrix_modification_time = matrix_timestamp;
+ last_encoder_modification_time = encoder_timestamp;
+ last_input_modification_time = MAX(matrix_timestamp, encoder_timestamp);
}
// Only enable this if console is enabled to print to