diff --git a/Debug.cpp b/Debug.cpp index 078585a..b899171 100644 --- a/Debug.cpp +++ b/Debug.cpp @@ -32,7 +32,6 @@ MENU_ENTRY(EEPROM_ADD_ENTRY, "[a] Add last entry to EEPROM"); MENU_ENTRY(EEPROM_BACKUP_ENTRIES, "[B] Backup EEPROM entries"); MENU_ENTRY(NOTIFY_FAILURES, "[F] Notify failures"); MENU_ENTRY(CLEAR_ALERTS, "[A] Clear alerts"); -MENU_ENTRY(SLEEP, "[S] Sleep for 8s"); MENU_ENTRY(SLEEP_DEEP, "[s] Deep sleep for 10s"); MENU_ENTRY(QUESTION, "?"); @@ -56,7 +55,6 @@ const PROGMEM uint8_t commandIdMapping[] = { 'B', static_cast(debug::GPSTRACKER_DEBUG_COMMAND::EEPROM_BACKUP_ENTRIES), 'F', static_cast(debug::GPSTRACKER_DEBUG_COMMAND::NOTIFY_FAILURES), 'A', static_cast(debug::GPSTRACKER_DEBUG_COMMAND::CLEAR_ALERTS), - 'S', static_cast(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP), 's', static_cast(debug::GPSTRACKER_DEBUG_COMMAND::SLEEP_DEEP), }; @@ -97,7 +95,6 @@ const char * const MENU_ENTRIES[] PROGMEM = { MENU_CLEAR_ALERTS, MENU_SEPARATOR, - MENU_SLEEP, MENU_SLEEP_DEEP, MENU_QUESTION @@ -115,7 +112,7 @@ namespace debug { namespace details { inline void displayPosition(PositionEntry entry) { - Log.notice(F("%d%%, %dmV, %f°C, %ds, %d, %s\n"), entry.metadata.batteryLevel, entry.metadata.batteryVoltage, entry.metadata.temperature, entry.metadata.timeToFix, entry.metadata.status, entry.position); + Log.notice(F("%d%%, %dmV, %f�C, %ds, %d, %s\n"), entry.metadata.batteryLevel, entry.metadata.batteryVoltage, entry.metadata.temperature, entry.metadata.timeToFix, entry.metadata.status, entry.position); } } @@ -131,7 +128,7 @@ namespace debug { size_t mappingArraySize = flash::getArraySize(commandIdMapping); char commandId; - for (uint8_t i = 0; i < mappingArraySize; i += 2) { + for (uint8_t i = 0; i < mappingArraySize; i += 2) { commandId = pgm_read_byte_near(commandIdMapping + i); if (commandId == id) return static_cast(pgm_read_byte_near(commandIdMapping + i + 1)); } @@ -144,7 +141,7 @@ namespace debug { size_t menuSize = flash::getArraySize(MENU_ENTRIES); uint8_t intermediate_timeout = 50; - do { + do { for (uint8_t i = 0; i < menuSize; i++) { Serial.println(reinterpret_cast(pgm_read_word_near(&MENU_ENTRIES[i]))); } @@ -162,7 +159,7 @@ namespace debug { command = parseCommand(Serial.read()); while (Serial.available()) Serial.read(); //flushing input } while (command == GPSTRACKER_DEBUG_COMMAND::NONE); - + return command; } @@ -272,7 +269,7 @@ namespace debug { void notifyFailures() { PositionEntryMetadata metadata = { 1, //all battery alerts should goes on with this - 3800, //doesn't matter + 3800, //doesn't matter ALERT_SUSPICIOUS_RTC_TEMPERATURE, 0, SIM808_GPS_STATUS::OFF @@ -286,7 +283,7 @@ namespace debug { void clearAlerts() { PositionEntryMetadata metadata = { 100, //all battery alerts should goes off with this - 3800, //doesn't matter + 3800, //doesn't matter 10, 0, SIM808_GPS_STATUS::OFF diff --git a/Debug.h b/Debug.h index d9a1cd0..b02fea7 100644 --- a/Debug.h +++ b/Debug.h @@ -33,7 +33,6 @@ namespace debug { EEPROM_BACKUP_ENTRIES, NOTIFY_FAILURES, CLEAR_ALERTS, - SLEEP, SLEEP_DEEP }; diff --git a/GpsTracker.ino b/GpsTracker.ino index 6e382a1..984c9bb 100644 --- a/GpsTracker.ino +++ b/GpsTracker.ino @@ -86,9 +86,6 @@ void loop() { case debug::GPSTRACKER_DEBUG_COMMAND::CLEAR_ALERTS: debug::clearAlerts(); break; - case debug::GPSTRACKER_DEBUG_COMMAND::SLEEP: - mainunit::sleep(period_t::SLEEP_8S); - break; case debug::GPSTRACKER_DEBUG_COMMAND::SLEEP_DEEP: mainunit::deepSleep(10); break; diff --git a/MainUnit.cpp b/MainUnit.cpp index e72e2aa..1fdb6bc 100644 --- a/MainUnit.cpp +++ b/MainUnit.cpp @@ -35,14 +35,6 @@ namespace mainunit { attachInterrupt(digitalPinToInterrupt(RTC_WAKE), interrupt, FALLING); } - void sleep(period_t period) { - NOTICE_FORMAT("sleep", "Period : %d", period); - details::prepareSleep(); - LowPower.powerDown(period, ADC_OFF, BOD_OFF); - details::wokeUp(); - - } - void deepSleep(uint16_t seconds) { NOTICE_FORMAT("deepSleep", "%d seconds", seconds); interruptIn(seconds); diff --git a/MainUnit.h b/MainUnit.h index 8a7b633..791894a 100644 --- a/MainUnit.h +++ b/MainUnit.h @@ -4,6 +4,5 @@ #include namespace mainunit { - void sleep(period_t period); void deepSleep(uint16_t seconds); } \ No newline at end of file