mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-12 12:57:27 +00:00
I thought git would be smart enough to understand all the whitespace changes but even with all the flags I know to make it ignore theses it still blows up if there are identical changes on both sides.
I have a solution but it require creating a new commit at the merge base for each conflicting PR and merging it into develop.
I don't think blowing up all PRs is worth for now, maybe if we can coordinate this for V3 let's say.
This reverts commit 0d11331d18.
This commit is contained in:
@@ -18,103 +18,107 @@
|
||||
|
||||
SystemCommandsModule *systemCommandsModule;
|
||||
|
||||
SystemCommandsModule::SystemCommandsModule() {
|
||||
if (inputBroker)
|
||||
inputObserver.observe(inputBroker);
|
||||
SystemCommandsModule::SystemCommandsModule()
|
||||
{
|
||||
if (inputBroker)
|
||||
inputObserver.observe(inputBroker);
|
||||
}
|
||||
|
||||
int SystemCommandsModule::handleInputEvent(const InputEvent *event) {
|
||||
LOG_INPUT("SystemCommands Input event %u! kb %u", event->inputEvent, event->kbchar);
|
||||
// System commands (all others fall through)
|
||||
switch (event->kbchar) {
|
||||
// Fn key symbols
|
||||
case INPUT_BROKER_MSG_FN_SYMBOL_ON:
|
||||
case INPUT_BROKER_MSG_FN_SYMBOL_OFF:
|
||||
return 0;
|
||||
// Brightness
|
||||
case INPUT_BROKER_MSG_BRIGHTNESS_UP:
|
||||
IF_SCREEN(screen->increaseBrightness());
|
||||
LOG_DEBUG("Increase Screen Brightness");
|
||||
return 0;
|
||||
case INPUT_BROKER_MSG_BRIGHTNESS_DOWN:
|
||||
IF_SCREEN(screen->decreaseBrightness());
|
||||
LOG_DEBUG("Decrease Screen Brightness");
|
||||
return 0;
|
||||
// Mute
|
||||
case INPUT_BROKER_MSG_MUTE_TOGGLE:
|
||||
if (moduleConfig.external_notification.enabled && externalNotificationModule) {
|
||||
externalNotificationModule->setMute(externalNotificationModule->getMute());
|
||||
IF_SCREEN(if (!externalNotificationModule->getMute()) externalNotificationModule->stopNow();
|
||||
screen->showSimpleBanner(externalNotificationModule->getMute() ? "Notifications\nEnabled" : "Notifications\nDisabled", 3000);)
|
||||
}
|
||||
return 0;
|
||||
// Bluetooth
|
||||
case INPUT_BROKER_MSG_BLUETOOTH_TOGGLE:
|
||||
config.bluetooth.enabled = !config.bluetooth.enabled;
|
||||
LOG_INFO("User toggled Bluetooth");
|
||||
nodeDB->saveToDisk();
|
||||
#if defined(ARDUINO_ARCH_NRF52)
|
||||
if (!config.bluetooth.enabled) {
|
||||
disableBluetooth();
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 2000;
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
}
|
||||
#else
|
||||
if (!config.bluetooth.enabled) {
|
||||
disableBluetooth();
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF", 3000));
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
case INPUT_BROKER_MSG_REBOOT:
|
||||
IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0));
|
||||
nodeDB->saveToDisk();
|
||||
#if HAS_SCREEN
|
||||
messageStore.saveToFlash();
|
||||
#endif
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
// runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (event->inputEvent) {
|
||||
// GPS
|
||||
case INPUT_BROKER_GPS_TOGGLE:
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
if (gps) {
|
||||
if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED && config.position.fixed_position == false) {
|
||||
nodeDB->clearLocalPosition();
|
||||
int SystemCommandsModule::handleInputEvent(const InputEvent *event)
|
||||
{
|
||||
LOG_INPUT("SystemCommands Input event %u! kb %u", event->inputEvent, event->kbchar);
|
||||
// System commands (all others fall through)
|
||||
switch (event->kbchar) {
|
||||
// Fn key symbols
|
||||
case INPUT_BROKER_MSG_FN_SYMBOL_ON:
|
||||
case INPUT_BROKER_MSG_FN_SYMBOL_OFF:
|
||||
return 0;
|
||||
// Brightness
|
||||
case INPUT_BROKER_MSG_BRIGHTNESS_UP:
|
||||
IF_SCREEN(screen->increaseBrightness());
|
||||
LOG_DEBUG("Increase Screen Brightness");
|
||||
return 0;
|
||||
case INPUT_BROKER_MSG_BRIGHTNESS_DOWN:
|
||||
IF_SCREEN(screen->decreaseBrightness());
|
||||
LOG_DEBUG("Decrease Screen Brightness");
|
||||
return 0;
|
||||
// Mute
|
||||
case INPUT_BROKER_MSG_MUTE_TOGGLE:
|
||||
if (moduleConfig.external_notification.enabled && externalNotificationModule) {
|
||||
externalNotificationModule->setMute(externalNotificationModule->getMute());
|
||||
IF_SCREEN(if (!externalNotificationModule->getMute()) externalNotificationModule->stopNow(); screen->showSimpleBanner(
|
||||
externalNotificationModule->getMute() ? "Notifications\nEnabled" : "Notifications\nDisabled", 3000);)
|
||||
}
|
||||
return 0;
|
||||
// Bluetooth
|
||||
case INPUT_BROKER_MSG_BLUETOOTH_TOGGLE:
|
||||
config.bluetooth.enabled = !config.bluetooth.enabled;
|
||||
LOG_INFO("User toggled Bluetooth");
|
||||
nodeDB->saveToDisk();
|
||||
}
|
||||
gps->toggleGpsMode();
|
||||
const char *msg = (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) ? "GPS Enabled" : "GPS Disabled";
|
||||
IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner(msg, 3000);)
|
||||
}
|
||||
#if defined(ARDUINO_ARCH_NRF52)
|
||||
if (!config.bluetooth.enabled) {
|
||||
disableBluetooth();
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 2000;
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
}
|
||||
#else
|
||||
if (!config.bluetooth.enabled) {
|
||||
disableBluetooth();
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth OFF", 3000));
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Bluetooth ON\nRebooting", 3000));
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
// Mesh ping
|
||||
case INPUT_BROKER_SEND_PING:
|
||||
service->refreshLocalMeshNode();
|
||||
if (service->trySendPosition(NODENUM_BROADCAST, true)) {
|
||||
IF_SCREEN(screen->showSimpleBanner("Position\nSent", 3000));
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Node Info\nSent", 3000));
|
||||
return 0;
|
||||
case INPUT_BROKER_MSG_REBOOT:
|
||||
IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0));
|
||||
nodeDB->saveToDisk();
|
||||
#if HAS_SCREEN
|
||||
messageStore.saveToFlash();
|
||||
#endif
|
||||
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
|
||||
// runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
// Power control
|
||||
case INPUT_BROKER_SHUTDOWN:
|
||||
shutdownAtMsec = millis();
|
||||
return true;
|
||||
|
||||
default:
|
||||
// No other input events handled here
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
switch (event->inputEvent) {
|
||||
// GPS
|
||||
case INPUT_BROKER_GPS_TOGGLE:
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
if (gps) {
|
||||
if (config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED &&
|
||||
config.position.fixed_position == false) {
|
||||
nodeDB->clearLocalPosition();
|
||||
nodeDB->saveToDisk();
|
||||
}
|
||||
gps->toggleGpsMode();
|
||||
const char *msg =
|
||||
(config.position.gps_mode == meshtastic_Config_PositionConfig_GpsMode_ENABLED) ? "GPS Enabled" : "GPS Disabled";
|
||||
IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner(msg, 3000);)
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
// Mesh ping
|
||||
case INPUT_BROKER_SEND_PING:
|
||||
service->refreshLocalMeshNode();
|
||||
if (service->trySendPosition(NODENUM_BROADCAST, true)) {
|
||||
IF_SCREEN(screen->showSimpleBanner("Position\nSent", 3000));
|
||||
} else {
|
||||
IF_SCREEN(screen->showSimpleBanner("Node Info\nSent", 3000));
|
||||
}
|
||||
return true;
|
||||
// Power control
|
||||
case INPUT_BROKER_SHUTDOWN:
|
||||
shutdownAtMsec = millis();
|
||||
return true;
|
||||
|
||||
default:
|
||||
// No other input events handled here
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user