145 {
146 if (!driver) {
148 return;
149 }
150
151
152 fl::string engineName = driver->getName();
153
154
155 if (engineName.
empty()) {
157 return;
158 }
159
160
161 for (
const auto& entry :
mDrivers) {
162 if (entry.name == engineName) {
164 return;
165 }
166 break;
167 }
168 }
169
170
171 bool enabled = true;
174 }
175
176 mDrivers.push_back({priority, driver, engineName, enabled});
178
179
180
181
182
183
184
185
186#if FASTLED_HAS_DBG
187 IChannelDriver::Capabilities caps = driver->getCapabilities();
188 fl::string capStr;
189 if (caps.supportsClockless) {
190 capStr += "CLOCKLESS";
191 }
192 if (caps.supportsSpi) {
193 if (!capStr.
empty()) capStr +=
"|";
194 capStr += "SPI";
195 }
196 if (capStr.
empty()) {
197 capStr = "NONE";
198 }
199
200 FL_DBG(
"ChannelManager: Added driver '" << engineName.
c_str() <<
"' (priority " << priority <<
", caps: " << capStr.
c_str() <<
")");
201#endif
202
203
204
205
206
208}
IChannelDriver::PollNeededCallback mPollNeededCallback
Shared callback installed on drivers that can signal poll-needed events.
FL_NO_INLINE FL_COLD bool addDriverSlow(int priority, const fl::shared_ptr< IChannelDriver > &driver, const fl::string *engineName, AddDriverSlowReason reason) FL_NO_EXCEPT
Handle validation failures and the uncommon replacement flow outside the normal driver-registration p...
fl::vector< EngineEntry > mDrivers
Shared drivers sorted by priority descending (higher values first)
fl::string mExclusiveDriver
Exclusive driver name (empty if no exclusive mode)
bool empty() const FL_NO_EXCEPT
const char * c_str() const FL_NO_EXCEPT
void sort_small(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT