Skip to content

Commit e030014

Browse files
committed
uno r4 timer correction
1 parent 0e1c3a0 commit e030014

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/AudioTimer/AudioTimerRenesas.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
109109
TRACED();
110110
uint8_t timer_type = GPT_TIMER;
111111
int8_t tindex = FspTimer::get_available_timer(timer_type);
112-
if (tindex==0){
112+
if (tindex < 0){
113113
LOGE("Using pwm reserved timer");
114-
FspTimer::force_use_of_pwm_reserved_timer();
115-
tindex = FspTimer::get_available_timer(timer_type);
114+
tindex = FspTimer::get_available_timer(timer_type, true);
116115
}
117-
if (tindex==0){
116+
if (tindex < 0){
118117
LOGE("no timer");
119118
return false;
120119
}
120+
FspTimer::force_use_of_pwm_reserved_timer();
121121
LOGI("timer idx: %d", tindex);
122122
if(!audio_timer.begin(TIMER_MODE_PERIODIC, timer_type, tindex, rate, 0.0f, staticCallback, this)){
123123
LOGE("error:begin");

0 commit comments

Comments
 (0)