32 lines
600 B
C
32 lines
600 B
C
|
|
#ifndef GET_UTC_TIME_H
|
||
|
|
#define GET_UTC_TIME_H
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include <stdio.h>
|
||
|
|
#include <time.h>
|
||
|
|
#include <math.h>
|
||
|
|
|
||
|
|
const static double gpst0[] = {1980,1,6,0,0,0}; // Æðʼʱ¼ä
|
||
|
|
# define LEAPS 18
|
||
|
|
|
||
|
|
typedef struct
|
||
|
|
{
|
||
|
|
time_t time;
|
||
|
|
double sec;
|
||
|
|
}gtime_t;
|
||
|
|
|
||
|
|
gtime_t epoch2time(const double *ep);
|
||
|
|
|
||
|
|
gtime_t gpst2time(int week, double sec);
|
||
|
|
|
||
|
|
gtime_t timeadd(gtime_t t,double sec);
|
||
|
|
|
||
|
|
gtime_t GPSTime2UTCTime(int week,double sec,double leapsec);
|
||
|
|
|
||
|
|
uint16_t get_utc_time(uint16_t GPSweek);
|
||
|
|
|
||
|
|
uint16_t get_utc_year(uint16_t GPSweek);
|
||
|
|
|
||
|
|
uint8_t get_utc_month(uint16_t GPSweek);
|
||
|
|
|
||
|
|
#endif /* GET_UTC_TIME_H */
|