Small timer support fix Adding useful define in timer support.

master
Nathael Pajani 2 years ago
parent 2f6db87bf3
commit 3577bbcbb6

@ -273,7 +273,7 @@ int countertimer_tc_setup(uint8_t timer_num, const struct lpc_tc_config* conf)
/* Select between timer (counts on PCLK) and counter mode (counts on CAP events) */
if (conf->mode & LPC_TIMER_MODE_COUNTER) {
/* Configure the counter */
timer->regs->count_ctrl = (conf->count_control & 0x0F);
timer->regs->count_ctrl = (conf->count_control & 0x03);
timer->regs->count_ctrl |= LPC_COUNTER_INC_INPUT(conf->count_chan);
} else {
/* Timer mode */

@ -239,6 +239,7 @@ int timer_counter_config(uint8_t timer_num, const struct lpc_tc_config* conf);
* config field in timer_config struct upon timer setup)
* The interrupt flags are passed to the interrupt routine as argument.
*/
#define TIMER_NO_PRESCALE 0
int timer_on(uint8_t timer_num, uint32_t clkrate, void (*callback)(uint32_t));
/* Removes the main clock from the selected timer block */

Loading…
Cancel
Save