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