이 웹사이트는 자바스크립트 활성화가 필요합니다.
홈
탐색
도움말
로그인
GPS
/
gpstracker-firmware
의 미러
https://github.com/blemasle/gpstracker-firmware.git
보기
1
좋아요
0
포크
0
코드
이슈
0
릴리즈
8
위키
활동
소스 검색
Moved RTC time update from GPS to Core workflow rather than position acquisition. Avoid edge cases where the spend time measurement could be wrong because of time update in between the two measure points.
tags/v1.2.0
Bertrand Lemasle
6 년 전
부모
b63912bd29
커밋
c7063a5698
3개의 변경된 파일
과
16개의 추가작업
그리고
6개의 파일을 삭제
분할 보기
Diff Options
Show Stats
Download Patch File
Download Diff File
+15
-2
GpsTracker/Core.cpp
+1
-0
GpsTracker/Core.h
+0
-4
GpsTracker/Positions.cpp
+ 15
- 2
GpsTracker/Core.cpp
파일 보기
@@ -7,14 +7,19 @@
using namespace utils;
namespace core {
uint16_t sleepTime = SLEEP_DEFAULT_TIME_SECONDS;
uint8_t stoppedInARow = SLEEP_DEFAULT_STOPPED_THRESHOLD - 1;
void main() {
bool forceBackup = false;
positions::prepareBackup()
;
bool acquired = false
;
PositionEntryMetadata metadata;
if (positions::acquire(metadata)) {
positions::prepareBackup();
acquired = positions::acquire(metadata);
if (acquired) {
positions::appendLast(metadata);
forceBackup = updateSleepTime();
@@ -22,9 +27,17 @@ namespace core {
}
positions::doBackup(forceBackup);
if (acquired) updateRtcTime();
mainunit::deepSleep(sleepTime);
}
void updateRtcTime() {
tmElements_t time;
gps::getTime(time);
rtc::setTime(time);
}
bool updateSleepTime() {
uint8_t velocity = gps::getVelocity();
uint16_t result = mapSleepTime(velocity);
+ 1
- 0
GpsTracker/Core.h
파일 보기
@@ -14,6 +14,7 @@ namespace core {
extern uint16_t sleepTime;
void main();
void updateRtcTime();
bool updateSleepTime();
uint16_t mapSleepTime(uint8_t velocity);
}
+ 0
- 4
GpsTracker/Positions.cpp
파일 보기
@@ -70,10 +70,6 @@ namespace positions {
uint16_t timeToFix = rtc::getTime() - before;
tmElements_t time;
gps::getTime(time);
rtc::setTime(time);
metadata = {
battery.level,
battery.voltage,
쓰기
미리보기
불러오는 중...
취소
저장