1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-09-28 14:40:46 +00:00

Don't use time services, replace with system ticks

This commit is contained in:
cathery 2020-05-29 16:59:18 +03:00
parent dfa3d387bd
commit 8871e0073e
2 changed files with 2 additions and 7 deletions

View File

@ -33,15 +33,12 @@ void WriteToLog(const char *fmt, ...)
{
std::scoped_lock printLock(printMutex);
u64 ts;
TimeCalendarTime caltime;
timeGetCurrentTime(TimeType_LocalSystemClock, &ts);
timeToCalendarTimeWithMyRule(ts, &caltime, nullptr);
ams::TimeSpan ts = ams::os::ConvertToTimeSpan(ams::os::GetSystemTick());
FILE *fp = fopen(LOG_PATH, "a");
//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
va_list va;

View File

@ -62,7 +62,6 @@ extern "C" void __appInit(void)
hosversionSet(MAKEHOSVERSION(fw.major, fw.minor, fw.micro));
setsysExit();
R_ABORT_UNLESS(timeInitialize());
R_ABORT_UNLESS(hiddbgInitialize());
if (hosversionAtLeast(7, 0, 0))
R_ABORT_UNLESS(hiddbgAttachHdlsWorkBuffer());
@ -82,7 +81,6 @@ extern "C" void __appExit(void)
hiddbgExit();
fsdevUnmountAll();
fsExit();
timeExit();
}
using namespace syscon;