Skip to content

Commit

Permalink
Merge pull request #701 from luni64/master
Browse files Browse the repository at this point in the history
IntervalTimer: remove leftover update specialization
  • Loading branch information
PaulStoffregen authored Jan 27, 2024
2 parents fa1ac65 + e4bf003 commit 9a0eef6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions teensy4/IntervalTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ class IntervalTimer {
// Change the timer's interval. The current interval is completed
// as previously configured, and then the next interval begins with
// with this new setting.
void update(unsigned int microseconds) {
if (microseconds == 0 || microseconds > MAX_PERIOD) return;
uint32_t cycles = (24000000 / 1000000) * microseconds - 1;
if (cycles < 17) return;
if (channel) channel->LDVAL = cycles;
}
// Change the timer's interval. The current interval is completed
// as previously configured, and then the next interval begins with
// with this new setting.
template <typename period_t>
void update(period_t period){
uint32_t cycles = cyclesFromPeriod(period);
Expand Down Expand Up @@ -121,7 +112,7 @@ class IntervalTimer {
template <typename period_t>
uint32_t cyclesFromPeriod(period_t period) {
static_assert(std::is_arithmetic_v<period_t>, "Period must be arithmetic");

if (period < 0 || period > MAX_PERIOD)
return 0;
if constexpr (std::is_integral_v<period_t>) // handles all integral types
Expand Down

0 comments on commit 9a0eef6

Please sign in to comment.