Skip to content

Commit dd9f7b3

Browse files
committed
added verbose output for the startup menu
1 parent 1573d13 commit dd9f7b3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

sfeIoTNodeLoRaWAN/sfeIoTNodeLoRaWAN.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ void sfeIoTNodeLoRaWAN::onInitStartupCommands(uint32_t delaySecs)
128128
const char *name;
129129
} startupCommand_t;
130130
startupCommand_t commands[] = {{'n', kAppOpNone, "normal-startup"},
131+
{'v', kAppOpStartVerboseOutput, "verbose-output-enabled"},
131132
{'a', kAppOpStartNoAutoload, "device-auto-load-disabled"},
132133
{'l', kAppOpStartListDevices, "i2c-driver-listing-enabled"},
133134
{'s', kAppOpStartNoSettings, "settings-restore-disabled"}};
@@ -304,15 +305,15 @@ bool sfeIoTNodeLoRaWAN::onSetup()
304305
// was settings restore disabled by startup commands?
305306
if (inOpMode(kAppOpStartNoSettings))
306307
flux.setLoadSettings(false);
307-
;
308308

309-
// was wifi startup disabled by startup commands?
309+
// Verbose output
310+
if (inOpMode(kAppOpStartVerboseOutput))
311+
set_verbose(true);
312+
313+
// was list device divers set by startup commands?
310314
if (inOpMode(kAppOpStartListDevices))
311315
flux.dumpDeviceAutoLoadTable();
312316

313-
// Serial UX - pass to our update routine
314-
// _sysUpdate.setSerialSettings(_serialSettings);
315-
316317
// Button events we're listening on
317318
_boardButton.on_momentaryPress.call(this, &sfeIoTNodeLoRaWAN::onLogEvent);
318319

@@ -719,9 +720,11 @@ void sfeIoTNodeLoRaWAN::set_termBaudRate(uint32_t newRate)
719720
//---------------------------------------------------------------------------
720721
void sfeIoTNodeLoRaWAN::set_verbose(bool enable)
721722
{
723+
724+
// If disable, but we are in startup mode that enables verbose, don't set disable
722725
if (enable)
723726
flxSetLoggingVerbose();
724-
else
727+
else if (!inOpMode(kAppOpStartVerboseOutput))
725728
flxSetLoggingInfo();
726729
}
727730
bool sfeIoTNodeLoRaWAN::get_verbose(void)

sfeIoTNodeLoRaWAN/sfeIoTNodeLoRaWAN.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ const uint32_t kBatteryCheckInterval = 90000;
5252
#define kAppOpStartNoAutoload (1 << 3)
5353
#define kAppOpStartListDevices (1 << 4)
5454
#define kAppOpStartNoSettings (1 << 5)
55+
#define kAppOpStartVerboseOutput (1 << 6)
5556

56-
#define kAppOpStartAllFlags (kAppOpStartNoAutoload | kAppOpStartListDevices | kAppOpStartNoSettings)
57+
#define kAppOpStartAllFlags \
58+
(kAppOpStartNoAutoload | kAppOpStartListDevices | kAppOpStartNoSettings | kAppOpStartVerboseOutput)
5759

5860
#define inOpMode(__mode__) ((_opFlags & __mode__) == __mode__)
5961
#define setOpMode(__mode__) _opFlags |= __mode__

0 commit comments

Comments
 (0)