@@ -167,10 +167,24 @@ void menuSystem()
167
167
168
168
systemPrintln (" ----- Settings -----" );
169
169
170
- if (present.beeper == true )
170
+ systemPrint (" a) Automatic device reboot in minutes: " );
171
+ if (settings.rebootMinutes == 0 )
172
+ systemPrintln (" Disabled" );
173
+ else
171
174
{
172
- systemPrint (" a) Audible Prompts: " );
173
- systemPrintf (" %s\r\n " , settings.enableBeeper ? " Enabled" : " Disabled" );
175
+ int days;
176
+ int hours;
177
+ int minutes;
178
+
179
+ const int minutesInADay = 60 * 24 ;
180
+
181
+ minutes = settings.rebootMinutes ;
182
+ days = minutes / minutesInADay;
183
+ minutes -= days * minutesInADay;
184
+ hours = minutes / 60 ;
185
+ minutes -= hours * 60 ;
186
+
187
+ systemPrintf (" %d (%d days %d:%02d)\r\n " , settings.rebootMinutes , days, hours, minutes);
174
188
}
175
189
176
190
systemPrint (" b) Set Bluetooth Mode: " );
@@ -204,6 +218,12 @@ void menuSystem()
204
218
systemPrintln (" f) Display microSD Files" );
205
219
}
206
220
221
+ if (present.beeper == true )
222
+ {
223
+ systemPrint (" g) Enable Beeper: " );
224
+ systemPrintf (" %s\r\n " , settings.enableBeeper ? " Enabled" : " Disabled" );
225
+ }
226
+
207
227
systemPrintln (" h) Debug hardware" );
208
228
209
229
systemPrintln (" n) Debug network" );
@@ -230,9 +250,38 @@ void menuSystem()
230
250
231
251
byte incoming = getUserInputCharacterNumber ();
232
252
233
- if (incoming == ' a' && present. beeper == true )
253
+ if (incoming == ' a' )
234
254
{
235
- settings.enableBeeper ^= 1 ;
255
+ // We use millis (uint32_t) to measure the reboot interval. 4294967000 is just less than (2^32 - 1)
256
+ systemPrint (" Enter uptime minutes before reboot, Disabled = 0, Reboot range (1 - 4294967): " );
257
+ int rebootMinutes = getUserInputNumber (); // Returns EXIT, TIMEOUT, or long
258
+ if ((rebootMinutes != INPUT_RESPONSE_GETNUMBER_EXIT) && (rebootMinutes != INPUT_RESPONSE_GETNUMBER_TIMEOUT))
259
+ {
260
+ if (rebootMinutes < 1 || rebootMinutes > 4294967 ) // Disable the reboot
261
+ {
262
+ settings.rebootMinutes = 0 ;
263
+ systemPrintln (" Reset is disabled" );
264
+ }
265
+ else
266
+ {
267
+ int days;
268
+ int hours;
269
+ int minutes;
270
+
271
+ const int minutesInADay = 60 * 24 ;
272
+
273
+ // Set the reboot time
274
+ settings.rebootMinutes = rebootMinutes;
275
+
276
+ minutes = settings.rebootMinutes ;
277
+ days = minutes / minutesInADay;
278
+ minutes -= days * minutesInADay;
279
+ hours = minutes / 60 ;
280
+ minutes -= hours * 60 ;
281
+
282
+ systemPrintf (" Reboot after uptime reaches %d days %d:%02d\r\n " , days, hours, minutes);
283
+ }
284
+ }
236
285
}
237
286
else if (incoming == ' b' )
238
287
{
@@ -262,6 +311,10 @@ void menuSystem()
262
311
{
263
312
printFileList ();
264
313
}
314
+ else if (incoming == ' g' && present.beeper == true )
315
+ {
316
+ settings.enableBeeper ^= 1 ;
317
+ }
265
318
else if (incoming == ' h' )
266
319
menuDebugHardware ();
267
320
else if (incoming == ' n' )
@@ -750,33 +803,14 @@ void menuDebugSoftware()
750
803
systemPrint (" 31) Print duplicate states: " );
751
804
systemPrintf (" %s\r\n " , settings.enablePrintDuplicateStates ? " Enabled" : " Disabled" );
752
805
753
- systemPrint (" 32) Automatic device reboot in minutes: " );
754
- if (settings.rebootMinutes == 0 )
755
- systemPrintln (" Disabled" );
756
- else
757
- {
758
- int days;
759
- int hours;
760
- int minutes;
761
-
762
- const int minutesInADay = 60 * 24 ;
763
-
764
- minutes = settings.rebootMinutes ;
765
- days = minutes / minutesInADay;
766
- minutes -= days * minutesInADay;
767
- hours = minutes / 60 ;
768
- minutes -= hours * 60 ;
769
-
770
- systemPrintf (" %d (%d days %d:%02d)\r\n " , settings.rebootMinutes , days, hours, minutes);
771
- }
772
-
773
806
systemPrintf (" 33) Print boot times: %s\r\n " , settings.printBootTimes ? " Enabled" : " Disabled" );
774
807
775
808
systemPrintf (" 34) Print partition table: %s\r\n " , settings.printPartitionTable ? " Enabled" : " Disabled" );
776
809
777
810
// Debug
778
811
779
- systemPrintf (" 40) Print LittleFS and settings management: %s\r\n " , settings.debugSettings ? " Enabled" : " Disabled" );
812
+ systemPrintf (" 40) Print LittleFS and settings management: %s\r\n " ,
813
+ settings.debugSettings ? " Enabled" : " Disabled" );
780
814
781
815
// Tasks
782
816
systemPrint (" 50) Task Highwater Reporting: " );
@@ -823,39 +857,6 @@ void menuDebugSoftware()
823
857
settings.enablePrintStates ^= 1 ;
824
858
else if (incoming == 31 )
825
859
settings.enablePrintDuplicateStates ^= 1 ;
826
- else if (incoming == 32 )
827
- {
828
- // We use millis (uint32_t) to measure the reboot interval. 4294967000 is just less than (2^32 - 1)
829
- systemPrint (" Enter uptime minutes before reboot, Disabled = 0, Reboot range (1 - 4294967): " );
830
- int rebootMinutes = getUserInputNumber (); // Returns EXIT, TIMEOUT, or long
831
- if ((rebootMinutes != INPUT_RESPONSE_GETNUMBER_EXIT) && (rebootMinutes != INPUT_RESPONSE_GETNUMBER_TIMEOUT))
832
- {
833
- if (rebootMinutes < 1 || rebootMinutes > 4294967 ) // Disable the reboot
834
- {
835
- settings.rebootMinutes = 0 ;
836
- systemPrintln (" Reset is disabled" );
837
- }
838
- else
839
- {
840
- int days;
841
- int hours;
842
- int minutes;
843
-
844
- const int minutesInADay = 60 * 24 ;
845
-
846
- // Set the reboot time
847
- settings.rebootMinutes = rebootMinutes;
848
-
849
- minutes = settings.rebootMinutes ;
850
- days = minutes / minutesInADay;
851
- minutes -= days * minutesInADay;
852
- hours = minutes / 60 ;
853
- minutes -= hours * 60 ;
854
-
855
- systemPrintf (" Reboot after uptime reaches %d days %d:%02d\r\n " , days, hours, minutes);
856
- }
857
- }
858
- }
859
860
else if (incoming == 33 )
860
861
settings.printBootTimes ^= 1 ;
861
862
else if (incoming == 34 )
0 commit comments