kopia lustrzana https://github.com/OpenRTX/OpenRTX
Add GPS RTC time synchronization, remove debug prints
rodzic
e9f0a46823
commit
f850dbdc45
|
@ -36,7 +36,7 @@ void gps_taskFunc(char *line, int len, gps_t *state)
|
|||
state->longitude = minmea_tocoord(&frame.longitude);
|
||||
state->timestamp.hour = frame.time.hours;
|
||||
state->timestamp.minute = frame.time.minutes;
|
||||
state->timestamp.second = frame.time.seconds;
|
||||
state->timestamp.second = frame.time.seconds - 1;
|
||||
state->timestamp.day = 0;
|
||||
state->timestamp.date = frame.date.day;
|
||||
state->timestamp.month = frame.date.month;
|
||||
|
|
|
@ -321,39 +321,12 @@ static void gps_task(void *arg)
|
|||
// GPS readout is blocking, no need to delay here
|
||||
gps_taskFunc(line, len, &state.gps_data);
|
||||
|
||||
// Synchronize RTC with GPS UTC clock
|
||||
if(state.settings.gps_set_time)
|
||||
rtc_setTime(state.gps_data.timestamp);
|
||||
|
||||
// Unlock state mutex
|
||||
OSMutexPost(&state_mutex, OS_OPT_POST_NONE, &os_err);
|
||||
|
||||
// Debug prints
|
||||
//printf("Timestamp: %d:%d:%d %d/%d/%d\n\r",
|
||||
// state.gps_data.timestamp.hour,
|
||||
// state.gps_data.timestamp.minute,
|
||||
// state.gps_data.timestamp.second,
|
||||
// state.gps_data.timestamp.date,
|
||||
// state.gps_data.timestamp.month,
|
||||
// state.gps_data.timestamp.year);
|
||||
//printf("Fix quality: %d - %d\n\r",
|
||||
// state.gps_data.fix_quality,
|
||||
// state.gps_data.fix_type);
|
||||
//printf("Satellites tracked: %d/%d\n\r",
|
||||
// state.gps_data.satellites_tracked,
|
||||
// state.gps_data.satellites_in_view);
|
||||
//for(int i = 0; i < state.gps_data.satellites_in_view; i++)
|
||||
//{
|
||||
// printf("%d - elevation: %d azimuth: %d snr: %d\n\r",
|
||||
// state.gps_data.satellites[i].id,
|
||||
// state.gps_data.satellites[i].elevation,
|
||||
// state.gps_data.satellites[i].azimuth,
|
||||
// state.gps_data.satellites[i].snr);
|
||||
//}
|
||||
//printf("Coordinates: %f %f\n\r",
|
||||
// state.gps_data.latitude,
|
||||
// state.gps_data.longitude);
|
||||
//printf("Speed: %f km/h TMGM: %f deg TMGT: %f deg\n\r",
|
||||
// state.gps_data.speed,
|
||||
// state.gps_data.tmg_mag,
|
||||
// state.gps_data.tmg_true);
|
||||
//printf("\n\r\n\r");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue