Browse Source

Reduce memory usage

master
Starbeamrainbowlabs 3 years ago
parent
commit
159a87db17
  1. 4
      iot/main/gps.cpp
  2. 6
      iot/main/main.ino
  3. 13
      iot/main/power.cpp
  4. 4
      iot/main/power.h

4
iot/main/gps.cpp

@ -12,7 +12,7 @@ void gps_begin() { @@ -12,7 +12,7 @@ void gps_begin() {
}
void gps_fetch() {
Serial.print("[gps] Getting location: ");
Serial.print(F("[gps] Getting location: "));
uint32_t ms_last_update = millis();
// We WILL discover our location - if it's the last thing we do!
while(true) {
@ -40,7 +40,7 @@ void gps_fetch() { @@ -40,7 +40,7 @@ void gps_fetch() {
}
// Hooray!
Serial.println("ok");
Serial.println(F("ok"));
return;
}
}

6
iot/main/main.ino

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
void setup() {
Serial.begin(BAUD_PC);
Serial.println("[main] Beginning collection sequence.");
Serial.println(F("[main] Beginning collection sequence."));
random_begin();
@ -27,11 +27,11 @@ void setup() { @@ -27,11 +27,11 @@ void setup() {
TinyGPSPlus gps_data = gps_info();
gps_end();
Serial.print("[main] Location: ("); Serial.print(gps_data.location.lat()); Serial.print(", "); Serial.print(gps_data.location.lng()); Serial.println(")");
Serial.print(F("[main] Location: (")); Serial.print(gps_data.location.lat()); Serial.print(F(", ")); Serial.print(gps_data.location.lng()); Serial.println(F(")"));
uint32_t id = random_get();
Serial.print("[main] id: ");
Serial.print(F("[main] id: "));
Serial.println(id);
// Activate microSD card breakout board on the SPI bus

13
iot/main/power.cpp

@ -2,19 +2,20 @@ @@ -2,19 +2,20 @@
#include "settings.h"
/*
void power_gps_wakeup() {
Serial.println("Warn: GPS wakeup isn't implemented yet.");
Serial.println(F("Warn: GPS wakeup isn't implemented yet."));
}
void power_gps_standby() {
Serial.println("Warn: GPS standby isn't implemented yet.");
Serial.println(F("Warn: GPS standby isn't implemented yet."));
}
*/
void power_off() {
Serial.println(F("[power] Beginning shutdown sequence"));
Serial.println(F("[power] Switching GPS module to standby"));
power_gps_standby();
Serial.println(F("[power] Shutting down"));
// Serial.println(F("[power] Switching GPS module to standby"));
// power_gps_standby();
Serial.println(F("[power] Signalling TPL5111"));
pinMode(PIN_TPL_DONE, OUTPUT);

4
iot/main/power.h

@ -2,11 +2,11 @@ @@ -2,11 +2,11 @@
/**
* Wakes the GPS module up from standby.
*/
void power_gps_wakeup();
// void power_gps_wakeup();
/**
* Puts the GPS module into standby.
*/
void power_gps_standby();
// void power_gps_standby();
/**
* Signals that our work is complete and that we can turn off now to the

Loading…
Cancel
Save