Skip to content

Commit

Permalink
aw shucks
Browse files Browse the repository at this point in the history
  • Loading branch information
caveman99 committed Mar 24, 2024
1 parent c0db59d commit 099c922
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
also enable HAS_ option not specifically disabled by variant.h */
#include "architecture.h"

#ifndef DEFAULT_REBOOT_SECONDS
#define DEFAULT_REBOOT_SECONDS 7
#endif

#ifndef DEFAULT_SHUTDOWN_SECONDS
#define DEFAULT_SHUTDOWN_SECONDS 2
#endif

/* Step #3: mop up with disabled values for HAS_ options not handled by the above two */

// -----------------------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/modules/AdminModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#include "mqtt/MQTT.h"

#define DEFAULT_REBOOT_SECONDS 7

AdminModule *adminModule;
bool hasOpenEditTransaction;

Expand Down
8 changes: 2 additions & 6 deletions src/modules/CannedMessageModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,12 @@ int32_t CannedMessageModule::runOnce()
// handle fn+s for shutdown
case 0x9b:
screen->startShutdownScreen();
int s = 2;
LOG_INFO("Shutdown in %d seconds\n", s);
shutdownAtMsec = millis() + s * 1000;
shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000;
break;
// and fn+r for reboot
case 0x90:
screen->startRebootScreen();
int s = 2;
LOG_INFO("Reboot in %d seconds\n", s);
rebootAtMsec = millis() + s * 1000;
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
break;
default:
if (this->cursor == this->freetext.length()) {
Expand Down

0 comments on commit 099c922

Please sign in to comment.