sleep utils less code
This commit is contained in:
parent
7e26e97a12
commit
9bf929822a
|
|
@ -1,9 +1,7 @@
|
||||||
#include "configuration.h"
|
|
||||||
#include "sleep_utils.h"
|
#include "sleep_utils.h"
|
||||||
#include "power_utils.h"
|
#include "power_utils.h"
|
||||||
|
|
||||||
|
|
||||||
extern Beacon *currentBeacon;
|
|
||||||
extern uint32_t lastGPSTime;
|
extern uint32_t lastGPSTime;
|
||||||
extern bool gpsIsActive;
|
extern bool gpsIsActive;
|
||||||
|
|
||||||
|
|
@ -12,7 +10,7 @@ namespace SLEEP_Utils {
|
||||||
|
|
||||||
void gpsSleep() {
|
void gpsSleep() {
|
||||||
#ifdef HAS_GPS_CTRL
|
#ifdef HAS_GPS_CTRL
|
||||||
if (currentBeacon->gpsEcoMode && gpsIsActive) {
|
if (gpsIsActive) {
|
||||||
POWER_Utils::deactivateGPS();
|
POWER_Utils::deactivateGPS();
|
||||||
lastGPSTime = millis();
|
lastGPSTime = millis();
|
||||||
//
|
//
|
||||||
|
|
@ -24,7 +22,7 @@ namespace SLEEP_Utils {
|
||||||
|
|
||||||
void gpsWakeUp() {
|
void gpsWakeUp() {
|
||||||
#ifdef HAS_GPS_CTRL
|
#ifdef HAS_GPS_CTRL
|
||||||
if (currentBeacon->gpsEcoMode && !gpsIsActive) {
|
if (!gpsIsActive) {
|
||||||
POWER_Utils::activateGPS();
|
POWER_Utils::activateGPS();
|
||||||
//
|
//
|
||||||
Serial.println("GPS WAKEUP");
|
Serial.println("GPS WAKEUP");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue