Skip to content

Commit

Permalink
Fix crash when no settings (!)
Browse files Browse the repository at this point in the history
  • Loading branch information
ropg committed Feb 19, 2024
1 parent 4a99afe commit 6eddf30
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/OOKwiz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ bool OOKwiz::setup(bool skip_saved_defaults) {
*/
/// @return always returns `true`
bool OOKwiz::loop() {
// Have CLI's loop check the serial port for data
if (!serial_cli_disable) {
CLI::loop();
}
// If the transitionTimer is not set up, we're not ready to do anything yet
if (transitionTimer == nullptr) {
return true;
}
// Stuff that happens only once a seccond
if (esp_timer_get_time() - last_periodic > 1000000) {
// If any of the core parameters have changed in settings,
Expand All @@ -140,10 +148,6 @@ bool OOKwiz::loop() {
int new_r_t = Settings::getInt("repeat_timeout", -1);
last_periodic = esp_timer_get_time();
}
// Have CLI's loop check the serial port for data
if (!serial_cli_disable) {
CLI::loop();
}
// See if the packet in loop_compare has timed out
if (
loop_compare.train &&
Expand Down

0 comments on commit 6eddf30

Please sign in to comment.