IntervalTimer.h now has just one version of begin() that uses "template <typename period_t" and handles both integer and float period arguments, but there are still two versions of update(). One takes unsigned int and the other uses the template approach. Is this correct? Can update(unsigned int) be removed?
EDIT: I tested by commenting out the update(unsigned int), and the template version seems to work correctly for both integer and float arguments.
Code:
template <typename period_t>
bool begin(callback_t funct, period_t period) {
uint32_t cycles = cyclesFromPeriod(period);
return cycles >= 17 ? beginCycles(funct, cycles) : false;
}
// 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);
if (cycles < 17) return;
if (channel) channel->LDVAL = cycles;
}