| 285 | } |
| 286 | |
| 287 | void Channel::applyConfig(const ChannelConfig& config) { |
| 288 | mRgbOrder = config.rgb_order; |
| 289 | if (config.mName.has_value()) { |
| 290 | mName = config.mName.value(); |
| 291 | } |
| 292 | setLeds(config.mLeds); |
| 293 | // Sync mSettings from incoming options so the mWhiteCfg variant survives |
| 294 | // to showPixels(). Setters below are idempotent overlays on the same data. |
| 295 | mSettings = config.options; |
| 296 | setCorrection(config.options.mCorrection); |
| 297 | setTemperature(config.options.mTemperature); |
| 298 | setDither(config.options.mDitherMode); |
| 299 | applyWhiteCfg(*this, config.options); |
| 300 | auto& events = ChannelEvents::instance(); |
| 301 | events.onChannelConfigured(*this, config); |
| 302 | } |
| 303 | |
| 304 | int Channel::getClockPin() const { |
| 305 | if (const SpiChipsetConfig* spi = mChipset.ptr<SpiChipsetConfig>()) { |
no test coverage detected