Free a timer
| 182 | |
| 183 | // Free a timer |
| 184 | static void free_timer(u8 timer_idx) FL_NOEXCEPT { |
| 185 | if (timer_idx <= MAX_TIMER_INDEX) { |
| 186 | // Critical section: prevent interrupt from accessing freed resources |
| 187 | __disable_irq(); |
| 188 | timer_allocated[timer_idx] = false; |
| 189 | timer_handles[timer_idx] = nullptr; |
| 190 | __enable_irq(); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | // Allocate a free EIC channel |
| 195 | static bool allocate_eic_channel(u8& channel) FL_NOEXCEPT { |
no outgoing calls
no test coverage detected