mirror of
https://github.com/cathery/sys-con.git
synced 2025-03-29 22:20:09 +00:00
Don't use time services, replace with system ticks
This commit is contained in:
parent
dfa3d387bd
commit
8871e0073e
@ -33,15 +33,12 @@ void WriteToLog(const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
std::scoped_lock printLock(printMutex);
|
std::scoped_lock printLock(printMutex);
|
||||||
|
|
||||||
u64 ts;
|
ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick());
|
||||||
TimeCalendarTime caltime;
|
|
||||||
timeGetCurrentTime(TimeType_LocalSystemClock, &ts);
|
|
||||||
timeToCalendarTimeWithMyRule(ts, &caltime, nullptr);
|
|
||||||
|
|
||||||
FILE *fp = fopen(LOG_PATH, "a");
|
FILE *fp = fopen(LOG_PATH, "a");
|
||||||
|
|
||||||
//Print time
|
//Print time
|
||||||
fprintf(fp, "%04i-%02i-%02i %02i:%02i:%02i: ", caltime.year, caltime.month, caltime.day, caltime.hour, caltime.minute, caltime.second);
|
fprintf(fp, "%02lid %02li:%02li:%02li: ", ts.GetDays(), ts.GetHours() % 24, ts.GetMinutes() % 60, ts.GetSeconds() % 60);
|
||||||
|
|
||||||
//Print the actual text
|
//Print the actual text
|
||||||
va_list va;
|
va_list va;
|
||||||
|
@ -62,7 +62,6 @@ extern "C" void __appInit(void)
|
|||||||
hosversionSet(MAKEHOSVERSION(fw.major, fw.minor, fw.micro));
|
hosversionSet(MAKEHOSVERSION(fw.major, fw.minor, fw.micro));
|
||||||
setsysExit();
|
setsysExit();
|
||||||
|
|
||||||
R_ABORT_UNLESS(timeInitialize());
|
|
||||||
R_ABORT_UNLESS(hiddbgInitialize());
|
R_ABORT_UNLESS(hiddbgInitialize());
|
||||||
if (hosversionAtLeast(7, 0, 0))
|
if (hosversionAtLeast(7, 0, 0))
|
||||||
R_ABORT_UNLESS(hiddbgAttachHdlsWorkBuffer());
|
R_ABORT_UNLESS(hiddbgAttachHdlsWorkBuffer());
|
||||||
@ -82,7 +81,6 @@ extern "C" void __appExit(void)
|
|||||||
hiddbgExit();
|
hiddbgExit();
|
||||||
fsdevUnmountAll();
|
fsdevUnmountAll();
|
||||||
fsExit();
|
fsExit();
|
||||||
timeExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace syscon;
|
using namespace syscon;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user