Release a channel and cleanup
| 203 | |
| 204 | // Release a channel and cleanup |
| 205 | void releaseChannel(PwmPinState* ch) { |
| 206 | if (!ch || ch->pin < 0) return; |
| 207 | |
| 208 | fl::digitalWrite(ch->pin, fl::PinValue::Low); |
| 209 | |
| 210 | { |
| 211 | fl::isr::critical_section cs; |
| 212 | ch->pin = -1; |
| 213 | ch->backend = PwmBackend::None; |
| 214 | ch->frequency_hz = 0; |
| 215 | ch->duty_cycle = 0; |
| 216 | } |
| 217 | |
| 218 | maybeShutdownIsr(); |
| 219 | } |
| 220 | |
| 221 | } // namespace pwm_state |
| 222 |
no test coverage detected