setting up the GPT and changing the interval has different results.
Setup the GPT in continuous mode will set the ARR to interval.
Changing the interval will set the ARR to interval -1.
hal_gpt_lld.c
Code: Select all
void gpt_lld_start_timer(GPTDriver *gptp, gptcnt_t interval) {
gptp->tim->ARR = (uint32_t)(interval); /* Time constant. */
hal_gpt_lld.h
Code: Select all
#define gpt_lld_change_interval(gptp, interval) \
((gptp)->tim->ARR = (uint32_t)((interval) - 1))