|
|
@ -71,7 +71,7 @@ LEDControl::set_mode(uint8_t mode_) {
|
|
|
|
|
|
|
|
|
|
|
|
refreshAll();
|
|
|
|
refreshAll();
|
|
|
|
|
|
|
|
|
|
|
|
kaleidoscope::Hooks::onLEDModeChange();
|
|
|
|
Hooks::onLEDModeChange();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LEDControl::activate(LEDModeInterface *plugin) {
|
|
|
|
void LEDControl::activate(LEDModeInterface *plugin) {
|
|
|
@ -132,7 +132,7 @@ void LEDControl::syncLeds(void) {
|
|
|
|
Runtime.device().syncLeds();
|
|
|
|
Runtime.device().syncLeds();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kaleidoscope::EventHandlerResult LEDControl::onSetup() {
|
|
|
|
EventHandlerResult LEDControl::onSetup() {
|
|
|
|
set_all_leds_to({0, 0, 0});
|
|
|
|
set_all_leds_to({0, 0, 0});
|
|
|
|
|
|
|
|
|
|
|
|
LEDModeManager::setupPersistentLEDModes();
|
|
|
|
LEDModeManager::setupPersistentLEDModes();
|
|
|
@ -156,7 +156,7 @@ void LEDControl::enable() {
|
|
|
|
Runtime.device().syncLeds();
|
|
|
|
Runtime.device().syncLeds();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kaleidoscope::EventHandlerResult LEDControl::onKeyEvent(KeyEvent &event) {
|
|
|
|
EventHandlerResult LEDControl::onKeyEvent(KeyEvent &event) {
|
|
|
|
if (event.key.getFlags() != (SYNTHETIC | IS_INTERNAL | LED_TOGGLE))
|
|
|
|
if (event.key.getFlags() != (SYNTHETIC | IS_INTERNAL | LED_TOGGLE))
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
|
|
|
|
|
|
|
@ -190,12 +190,12 @@ kaleidoscope::EventHandlerResult LEDControl::onKeyEvent(KeyEvent &event) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return kaleidoscope::EventHandlerResult::EVENT_CONSUMED;
|
|
|
|
return EventHandlerResult::EVENT_CONSUMED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kaleidoscope::EventHandlerResult LEDControl::afterEachCycle() {
|
|
|
|
EventHandlerResult LEDControl::afterEachCycle() {
|
|
|
|
if (!enabled_)
|
|
|
|
if (!enabled_)
|
|
|
|
return kaleidoscope::EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
|
|
|
|
|
|
|
|
if (Runtime.hasTimeExpired(syncTimer, syncDelay)) {
|
|
|
|
if (Runtime.hasTimeExpired(syncTimer, syncDelay)) {
|
|
|
|
syncLeds();
|
|
|
|
syncLeds();
|
|
|
@ -203,7 +203,7 @@ kaleidoscope::EventHandlerResult LEDControl::afterEachCycle() {
|
|
|
|
update();
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return kaleidoscope::EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EventHandlerResult FocusLEDCommand::onFocusEvent(const char *command) {
|
|
|
|
EventHandlerResult FocusLEDCommand::onFocusEvent(const char *command) {
|
|
|
|