Selaa lähdekoodia

Reduced sleeping time for debugging purpose, and menu timeout is not effective after first command

tags/v1.2.0
Bertrand Lemasle 7 vuotta sitten
vanhempi
commit
878f509e4b
2 muutettua tiedostoa jossa 18 lisäystä ja 5 poistoa
  1. +11
    -2
      GpsTracker/Config.h
  2. +7
    -3
      GpsTracker/GpsTracker.ino

+ 11
- 2
GpsTracker/Config.h Näytä tiedosto

@@ -53,7 +53,7 @@ struct config_t {
namespace config { namespace config {


static const sleepTimings_t defaultSleepTimings[] PROGMEM = { static const sleepTimings_t defaultSleepTimings[] PROGMEM = {
{ 5, SLEEP_DEFAULT_TIME_SECONDS },
/*{ 5, SLEEP_DEFAULT_TIME_SECONDS },
{ 10, 1200 }, { 10, 1200 },
{ 20, 600 }, { 20, 600 },
{ 30, 540 }, { 30, 540 },
@@ -61,8 +61,17 @@ namespace config {
{ 80, 240 }, { 80, 240 },
{ 100, 210 }, { 100, 210 },
{ 180, 180 }, { 180, 180 },
};
};*/


{ 5, 600 },
{ 10, 600 },
{ 20, 600 },
{ 30, 540 },
{ 50, 480 },
{ 80, 240 },
{ 100, 210 },
{ 180, 180 },
};
namespace main { namespace main {
extern config_t value; extern config_t value;




+ 7
- 3
GpsTracker/GpsTracker.ino Näytä tiedosto

@@ -2,12 +2,13 @@
#include "Positions.h" #include "Positions.h"


#if _DEBUG #if _DEBUG
#define MENU_TIMEOUT 0
#define MENU_DEFAULT_TIMEOUT 0
#else #else
#define MENU_TIMEOUT 0
#define MENU_DEFAULT_TIMEOUT 5000


#endif #endif
bool bypassMenu = false; bool bypassMenu = false;
uint16_t menuTimeout = MENU_DEFAULT_TIMEOUT;


void setup() { void setup() {
logging::setup(); logging::setup();
@@ -22,7 +23,10 @@ void setup() {
void loop() { void loop() {


debug::GPSTRACKER_DEBUG_COMMAND command = debug::GPSTRACKER_DEBUG_COMMAND::RUN; debug::GPSTRACKER_DEBUG_COMMAND command = debug::GPSTRACKER_DEBUG_COMMAND::RUN;
if (Serial && !bypassMenu) command = debug::menu(MENU_TIMEOUT);
if (Serial && !bypassMenu) command = debug::menu(menuTimeout);

if (command == debug::GPSTRACKER_DEBUG_COMMAND::RUN) bypassMenu = true;
else menuTimeout = 0; //disable timeout once a command has been entered


bypassMenu = command == debug::GPSTRACKER_DEBUG_COMMAND::RUN; bypassMenu = command == debug::GPSTRACKER_DEBUG_COMMAND::RUN;




Ladataan…
Peruuta
Tallenna