1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-09-28 22:40:47 +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); 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;

View File

@ -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;