add seconds since epoch to datetime struct
This commit is contained in:
@ -56,6 +56,7 @@ typedef struct _datetime
|
||||
uint8_t hh;
|
||||
uint8_t mm;
|
||||
uint8_t ss;
|
||||
uint64_t seconds;
|
||||
} datetime;
|
||||
|
||||
#define ntp_port 123 //ntp server port number
|
||||
@ -63,7 +64,7 @@ typedef struct _datetime
|
||||
#define UTC_ADJ_HRS 9 // SEOUL : GMT+9
|
||||
#define EPOCH 1900 // NTP start year
|
||||
|
||||
void get_seconds_from_ntp_server(uint8_t *buf, uint16_t idx);
|
||||
uint64_t get_seconds_from_ntp_server(uint8_t *buf, uint16_t idx);
|
||||
void SNTP_init(uint8_t s, uint8_t *ntp_server, uint8_t tz, uint8_t *buf);
|
||||
int8_t SNTP_run(datetime *time);
|
||||
tstamp changedatetime_to_seconds(void);
|
||||
|
Reference in New Issue
Block a user