You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FspTimer does not initialize properly if AGT timer is selected.
If the begin method:
```
/* -------------------------------------------------------------------------- */
bool FspTimer::begin(timer_mode_t mode, uint8_t tp, uint8_t channel, float freq_hz, float duty_perc, GPTimerCbk_f cbk /*= nullptr*/ , void *ctx /*= nullptr*/ ) {
/* -------------------------------------------------------------------------- */
```
Is called with the tp=1 (AGT)
It will fail as this method uses the member variable type to decide if it is
working with GPT or AGT. Problem is that this member is not set until after the code has decided that the parameters are correct and it then calls the begin with the period counts.
So needed to use the passed in parameter tp instead. Also this begin
method called set_period_counts to convert the data into the counts. This method also relied on the member type. So changed it to pass in the tp parameter.
More details are in the forum thread:
https://forum.arduino.cc/t/fsptimer-using-agt-timer-issues/1164494
0 commit comments