| 34 | } |
| 35 | |
| 36 | void executeToggles(fl::RxChannel& rx, |
| 37 | fl::span<const PinToggle> toggles, |
| 38 | int pin_tx, |
| 39 | uint32_t wait_ms) { |
| 40 | const fl::RxChannelConfig& config = rx.config(); |
| 41 | |
| 42 | // Set pin to initial state before begin() |
| 43 | pinMode(pin_tx, OUTPUT); |
| 44 | digitalWrite(pin_tx, config.start_low ? LOW : HIGH); |
| 45 | fl::delayMicroseconds(100); // Allow pin to settle |
| 46 | |
| 47 | // Initialize RX channel |
| 48 | if (!rx.begin(config)) { |
| 49 | FL_ERROR("Failed to initialize RX channel"); |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | // Execute pin toggles |
| 54 | for (size_t i = 0; i < toggles.size(); i++) { |
| 55 | digitalWrite(pin_tx, toggles[i].is_high ? HIGH : LOW); |
| 56 | fl::delayMicroseconds(toggles[i].delay_us); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | bool validateEdgeTiming(fl::span<const fl::EdgeTime> edges, |
| 61 | size_t edge_count, |
nothing calls this directly
no test coverage detected