diff options
| -rw-r--r-- | platforms/avr/timer.c | 28 | ||||
| -rw-r--r-- | platforms/chibios/timer.c | 8 | ||||
| -rw-r--r-- | platforms/test/timer.c | 8 | ||||
| -rw-r--r-- | platforms/timer.c | 8 | ||||
| -rw-r--r-- | quantum/debounce/tests/rules.mk | 1 | ||||
| -rw-r--r-- | quantum/os_detection/tests/rules.mk | 1 | ||||
| -rw-r--r-- | quantum/sequencer/tests/rules.mk | 1 |
7 files changed, 11 insertions, 44 deletions
diff --git a/platforms/avr/timer.c b/platforms/avr/timer.c index 26ba0e29fa..b2230ad84b 100644 --- a/platforms/avr/timer.c +++ b/platforms/avr/timer.c | |||
| @@ -125,34 +125,6 @@ inline uint32_t timer_read32(void) { | |||
| 125 | return t; | 125 | return t; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | /** \brief timer elapsed | ||
| 129 | * | ||
| 130 | * FIXME: needs doc | ||
| 131 | */ | ||
| 132 | inline uint16_t timer_elapsed(uint16_t last) { | ||
| 133 | uint32_t t; | ||
| 134 | |||
| 135 | ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { | ||
| 136 | t = timer_count; | ||
| 137 | } | ||
| 138 | |||
| 139 | return TIMER_DIFF_16((t & 0xFFFF), last); | ||
| 140 | } | ||
| 141 | |||
| 142 | /** \brief timer elapsed32 | ||
| 143 | * | ||
| 144 | * FIXME: needs doc | ||
| 145 | */ | ||
| 146 | inline uint32_t timer_elapsed32(uint32_t last) { | ||
| 147 | uint32_t t; | ||
| 148 | |||
| 149 | ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { | ||
| 150 | t = timer_count; | ||
| 151 | } | ||
| 152 | |||
| 153 | return TIMER_DIFF_32(t, last); | ||
| 154 | } | ||
| 155 | |||
| 156 | // excecuted once per 1ms.(excess for just timer count?) | 128 | // excecuted once per 1ms.(excess for just timer count?) |
| 157 | #ifndef __AVR_ATmega32A__ | 129 | #ifndef __AVR_ATmega32A__ |
| 158 | # define TIMER_INTERRUPT_VECTOR TIMER0_COMPA_vect | 130 | # define TIMER_INTERRUPT_VECTOR TIMER0_COMPA_vect |
diff --git a/platforms/chibios/timer.c b/platforms/chibios/timer.c index a07cf5714f..9f7eade83f 100644 --- a/platforms/chibios/timer.c +++ b/platforms/chibios/timer.c | |||
| @@ -118,11 +118,3 @@ uint32_t timer_read32(void) { | |||
| 118 | 118 | ||
| 119 | return (uint32_t)TIME_I2MS(ticks) + ms_offset_copy; | 119 | return (uint32_t)TIME_I2MS(ticks) + ms_offset_copy; |
| 120 | } | 120 | } |
| 121 | |||
| 122 | uint16_t timer_elapsed(uint16_t last) { | ||
| 123 | return TIMER_DIFF_16(timer_read(), last); | ||
| 124 | } | ||
| 125 | |||
| 126 | uint32_t timer_elapsed32(uint32_t last) { | ||
| 127 | return TIMER_DIFF_32(timer_read32(), last); | ||
| 128 | } | ||
diff --git a/platforms/test/timer.c b/platforms/test/timer.c index eb929d7dac..f5ee07fd57 100644 --- a/platforms/test/timer.c +++ b/platforms/test/timer.c | |||
| @@ -60,14 +60,6 @@ uint32_t timer_read32(void) { | |||
| 60 | return current_time; | 60 | return current_time; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | uint16_t timer_elapsed(uint16_t last) { | ||
| 64 | return TIMER_DIFF_16(timer_read(), last); | ||
| 65 | } | ||
| 66 | |||
| 67 | uint32_t timer_elapsed32(uint32_t last) { | ||
| 68 | return TIMER_DIFF_32(timer_read32(), last); | ||
| 69 | } | ||
| 70 | |||
| 71 | void set_time(uint32_t t) { | 63 | void set_time(uint32_t t) { |
| 72 | current_time = t; | 64 | current_time = t; |
| 73 | access_counter = 0; | 65 | access_counter = 0; |
diff --git a/platforms/timer.c b/platforms/timer.c index 26038dcda3..ba2cf94d2b 100644 --- a/platforms/timer.c +++ b/platforms/timer.c | |||
| @@ -6,3 +6,11 @@ | |||
| 6 | // Generate out-of-line copies for inline functions defined in timer.h. | 6 | // Generate out-of-line copies for inline functions defined in timer.h. |
| 7 | extern inline fast_timer_t timer_read_fast(void); | 7 | extern inline fast_timer_t timer_read_fast(void); |
| 8 | extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); | 8 | extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last); |
| 9 | |||
| 10 | uint16_t timer_elapsed(uint16_t last) { | ||
| 11 | return TIMER_DIFF_16(timer_read(), last); | ||
| 12 | } | ||
| 13 | |||
| 14 | uint32_t timer_elapsed32(uint32_t last) { | ||
| 15 | return TIMER_DIFF_32(timer_read32(), last); | ||
| 16 | } | ||
diff --git a/quantum/debounce/tests/rules.mk b/quantum/debounce/tests/rules.mk index bbc362d4c7..d38b1cd342 100644 --- a/quantum/debounce/tests/rules.mk +++ b/quantum/debounce/tests/rules.mk | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5 | 16 | DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5 |
| 17 | 17 | ||
| 18 | DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \ | 18 | DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \ |
| 19 | $(PLATFORM_PATH)/timer.c \ | ||
| 19 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c | 20 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c |
| 20 | 21 | ||
| 21 | debounce_none_DEFS := $(DEBOUNCE_COMMON_DEFS) | 22 | debounce_none_DEFS := $(DEBOUNCE_COMMON_DEFS) |
diff --git a/quantum/os_detection/tests/rules.mk b/quantum/os_detection/tests/rules.mk index 1b69b71ba9..2f31f5e391 100644 --- a/quantum/os_detection/tests/rules.mk +++ b/quantum/os_detection/tests/rules.mk | |||
| @@ -4,4 +4,5 @@ os_detection_DEFS += -DOS_DETECTION_DEBOUNCE=50 | |||
| 4 | os_detection_SRC := \ | 4 | os_detection_SRC := \ |
| 5 | $(QUANTUM_PATH)/os_detection/tests/os_detection.cpp \ | 5 | $(QUANTUM_PATH)/os_detection/tests/os_detection.cpp \ |
| 6 | $(QUANTUM_PATH)/os_detection.c \ | 6 | $(QUANTUM_PATH)/os_detection.c \ |
| 7 | $(PLATFORM_PATH)/timer.c \ | ||
| 7 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c | 8 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c |
diff --git a/quantum/sequencer/tests/rules.mk b/quantum/sequencer/tests/rules.mk index 611459e060..74b680ae31 100644 --- a/quantum/sequencer/tests/rules.mk +++ b/quantum/sequencer/tests/rules.mk | |||
| @@ -8,4 +8,5 @@ sequencer_SRC := \ | |||
| 8 | $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ | 8 | $(QUANTUM_PATH)/sequencer/tests/midi_mock.c \ |
| 9 | $(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \ | 9 | $(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \ |
| 10 | $(QUANTUM_PATH)/sequencer/sequencer.c \ | 10 | $(QUANTUM_PATH)/sequencer/sequencer.c \ |
| 11 | $(PLATFORM_PATH)/timer.c \ | ||
| 11 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c | 12 | $(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c |
