mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 21:32:39 +02:00
time: Expose TimeStandardSteadyClockTimePointType, correct TimeSystemClockContext
This commit is contained in:
parent
b18ae1c884
commit
b4db31e536
@ -58,8 +58,13 @@ typedef struct {
|
|||||||
} TimeSteadyClockTimePoint;
|
} TimeSteadyClockTimePoint;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
s64 time_point;
|
s64 base_time;
|
||||||
TimeSteadyClockTimePoint steady_clock_time_point;
|
Uuid source_id;
|
||||||
|
} TimeStandardSteadyClockTimePointType;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
s64 offset;
|
||||||
|
TimeSteadyClockTimePoint timestamp;
|
||||||
} TimeSystemClockContext;
|
} TimeSystemClockContext;
|
||||||
|
|
||||||
/// Initialize time. Used automatically during app startup.
|
/// Initialize time. Used automatically during app startup.
|
||||||
|
@ -163,13 +163,9 @@ Result timeGetStandardSteadyClockTimePoint(TimeSteadyClockTimePoint *out) {
|
|||||||
return serviceDispatchOut(&g_timeSteadyClock, 0, *out);
|
return serviceDispatchOut(&g_timeSteadyClock, 0, *out);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct { // SteadyClockContext
|
TimeStandardSteadyClockTimePointType context;
|
||||||
u64 internal_offset;
|
|
||||||
Uuid source_id;
|
|
||||||
} context;
|
|
||||||
|
|
||||||
_timeReadSharedmemObj(&context, 0x00, sizeof(context));
|
_timeReadSharedmemObj(&context, 0x00, sizeof(context));
|
||||||
out->time_point = (context.internal_offset + armTicksToNs(armGetSystemTick())) / 1000000000UL;
|
out->time_point = (context.base_time + armTicksToNs(armGetSystemTick())) / 1000000000UL;
|
||||||
out->source_id = context.source_id;
|
out->source_id = context.source_id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user