您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
616 B

  1. #include "GpsTracker.h"
  2. void setup() {
  3. #ifdef _DEBUG
  4. debug::waitForSerial();
  5. Log.begin(LOG_LEVEL_VERBOSE, &Serial);
  6. #endif
  7. core::setCurrentState(GPS_TRACKER_STATES::SETUP);
  8. rtc::powerOn();
  9. rtc::setup();
  10. rtc::powerOff();
  11. }
  12. void loop() {
  13. gps::powerOn();
  14. SIM808_GPS_STATUS gpsStatus = gps::acquireCurrentPosition();
  15. gps::powerOff();
  16. if (gpsStatus > SIM808_GPS_STATUS::NO_FIX) {
  17. time_t time = gps::getTime();
  18. rtc::powerOn();
  19. rtc::setTime(time);
  20. rtc::powerOff();
  21. positions::appendLast();
  22. }
  23. if (positions::needsToSend()) {
  24. positions::send();
  25. }
  26. mainunit::deepSleep(10); //duration TBD
  27. }