@brief Initialize channel drivers (registers stub driver for non-hardware platforms) For platforms without hardware-specific channel drivers (stub, posix, tests), this registers the stub driver as a fallback. This allows the legacy API to work and enables LED capture for testing.
| 22 | /// this registers the stub driver as a fallback. This allows the legacy API to work |
| 23 | /// and enables LED capture for testing. |
| 24 | inline void initChannelDrivers() FL_NOEXCEPT { |
| 25 | // Register the stub channel driver (low priority fallback) |
| 26 | // This allows tests and unsupported platforms to use the channel API |
| 27 | fl::ChannelManager& manager = fl::ChannelManager::instance(); |
| 28 | |
| 29 | // Get the stub driver singleton |
| 30 | auto* stubEngine = fl::getStubChannelEngine(); |
| 31 | |
| 32 | // Wrap it in a shared_ptr without taking ownership using make_shared_no_tracking |
| 33 | // This is a zero-overhead wrapper that doesn't create a control block |
| 34 | auto sharedStub = fl::make_shared_no_tracking(*stubEngine); |
| 35 | |
| 36 | // Register with low priority so platform-specific drivers can override |
| 37 | manager.addDriver(0, sharedStub); |
| 38 | } |
| 39 | |
| 40 | } // namespace platforms |
| 41 | } // namespace fl |
nothing calls this directly
no test coverage detected