Bugfix: Correct power signalling issues

master
Starbeamrainbowlabs 4 years ago
parent 1a39c5902e
commit cc3c0d9d63
  1. 2
      iot/main/gps.cpp
  2. 2
      iot/main/main.ino
  3. 6
      iot/main/power.cpp
  4. 6
      iot/main/power.h
  5. 2
      iot/main/settings.h

@ -57,8 +57,8 @@ GPSLocation gps_fetch() {
Serial.println();
ticks = 0;
}
ms_last_update = millis();
}
ms_last_update = millis();
continue;
}

@ -22,6 +22,8 @@ void setup() {
Serial.println(F("[main] Starting"));
random_begin();
power_init();
DISPLAY_FREE_MEMORY();
GPSLocation gps_data = gps_fetch();
DISPLAY_FREE_MEMORY();

@ -2,11 +2,15 @@
#include "settings.h"
void power_init() {
pinMode(PIN_TPL_DONE, OUTPUT);
digitalWrite(PIN_TPL_DONE, LOW);
}
void power_off() {
Serial.println(F("[power] Shutting down"));
// Serial.println(F("[power] Switching GPS module to standby"));
// power_gps_standby();
pinMode(PIN_TPL_DONE, OUTPUT);
digitalWrite(PIN_TPL_DONE, HIGH);
// Wait until we're turned off

@ -1,4 +1,10 @@
/**
* Initialises the TPL5111 done pin to be LOW, so that it catches it when we
* set it to HIGH later.
*/
void power_init();
/**
* Signals that our work is complete and that we can turn off now to the
* TPL5111.

@ -25,7 +25,7 @@
#define PIN_SPI_DATA 9
// The 'done' pin to pulse to signal to the TPL5111
#define PIN_TPL_DONE 8
#define PIN_TPL_DONE A0
// Uncomment to print RAM diagnostics at regular intervals.
//#define ENABLE_MEMORY_DIAGNOSTICS

Loading…
Cancel
Save