Skip to content

Commit 6aa4dea

Browse files
committed
FspTimer: free channel on destructor
It might also make senso to do it on close() (for shared instances and static objects)
1 parent 309e074 commit 6aa4dea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cores/arduino/FspTimer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ FspTimer::FspTimer(): init_ok(false), agt_timer(nullptr), gpt_timer(nullptr), ty
1818

1919
FspTimer::~FspTimer() {
2020
if(agt_timer != nullptr) {
21+
agt_used_channel[timer_cfg.channel] = TIMER_FREE;
2122
delete agt_timer;
2223
agt_timer = nullptr;
2324
}
2425
if(gpt_timer != nullptr) {
26+
gpt_used_channel[timer_cfg.channel] = TIMER_FREE;
2527
delete gpt_timer;
2628
gpt_timer = nullptr;
2729
}

0 commit comments

Comments
 (0)