138 {
139 if (!driver) {
141 return;
142 }
143
144
145 fl::string engineName = driver->getName();
146
147
148 if (engineName.
empty()) {
150 return;
151 }
152
153
154 for (
const auto& entry :
mDrivers) {
155 if (entry.name == engineName) {
157 return;
158 }
159 break;
160 }
161 }
162
163
164 bool enabled = true;
167 }
168
169 mDrivers.push_back({priority, driver, engineName, enabled});
171
172
173
174
175
176
177
178
179#if FASTLED_HAS_DBG
180 IChannelDriver::Capabilities caps = driver->getCapabilities();
181 fl::string capStr;
182 if (caps.supportsClockless) {
183 capStr += "CLOCKLESS";
184 }
185 if (caps.supportsSpi) {
186 if (!capStr.
empty()) capStr +=
"|";
187 capStr += "SPI";
188 }
189 if (capStr.
empty()) {
190 capStr = "NONE";
191 }
192
193 FL_DBG(
"ChannelManager: Added driver '" << engineName.
c_str() <<
"' (priority " << priority <<
", caps: " << capStr.
c_str() <<
")");
194#endif
195
196
197
198
199
201}
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