mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-29 13:03:38 +01:00
time: do not depend on gint headers
They're usually not installed yet
This commit is contained in:
parent
bd0dd3a8d2
commit
f7b85f18bd
2 changed files with 20 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <gint/rtc.h>
|
#include <inttypes.h>
|
||||||
#include <gint/defs/attributes.h>
|
|
||||||
|
uint32_t rtc_ticks(void);
|
||||||
|
|
||||||
static clock_t clock_init;
|
static clock_t clock_init;
|
||||||
|
|
||||||
|
@ -9,7 +10,8 @@ static clock_t clock_abs(void)
|
||||||
return (CLOCKS_PER_SEC * (uint64_t)rtc_ticks()) / 128;
|
return (CLOCKS_PER_SEC * (uint64_t)rtc_ticks()) / 128;
|
||||||
}
|
}
|
||||||
|
|
||||||
GCONSTRUCTOR static void clock_initialize(void)
|
__attribute__((constructor))
|
||||||
|
static void clock_initialize(void)
|
||||||
{
|
{
|
||||||
clock_init = clock_abs();
|
clock_init = clock_abs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <gint/rtc.h>
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint16_t year;
|
||||||
|
uint8_t week_day;
|
||||||
|
uint8_t month;
|
||||||
|
uint8_t month_day;
|
||||||
|
uint8_t hours;
|
||||||
|
uint8_t minutes;
|
||||||
|
uint8_t seconds;
|
||||||
|
uint8_t ticks;
|
||||||
|
|
||||||
|
} rtc_time_t;
|
||||||
|
|
||||||
|
void rtc_get_time(rtc_time_t *time);
|
||||||
|
|
||||||
time_t time(time_t *timeptr)
|
time_t time(time_t *timeptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue