This commit is contained in:
Adrien Bourmault 2019-05-05 23:29:17 +02:00
parent edcbbf966c
commit 272a0f243e
3 changed files with 6 additions and 17 deletions

View File

@ -39,6 +39,6 @@ extern void IoEnableRtc(void);
extern void IoPrintRtcTime(void);
extern ulong IoGetRtcTicks(void);
extern Time_t* IoGetRtcTime(void);
extern error_t IoGetRtcTimeChar(char* timeChar);
extern char* IoGetRtcTimeChar(void);
//static char* WeekDays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

View File

@ -94,17 +94,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
/* i++; */
/* } */
char cc[255];
IoGetRtcTimeChar(cc);
KernLog("\nTEST 1:\n");
KernLog("%s\n", cc);
KernLog("\nTEST 2:\n");
KernLog("[test] %s\n", cc);
KernLog("\nTEST 3:\n");
KernLog("[test] %s [fin du test]\n", cc);
KernLog("Goodbye at %s", IoGetRtcTimeChar());
// End this machine's suffering
BStdOut->flusher(BStdOut);

View File

@ -28,6 +28,7 @@
#include <kernel/time.h>
static ulong IoRtcTicks = 0;
static char IoTimeChar[22] = { 0 };
static uchar RtcRate = 0x05; //2048Hz
static Time_t IoRtcOriginTime;
static Time_t IoRtcTime;
@ -160,11 +161,10 @@ void IoPrintRtcTime(void)
);
}
// FIXME XXX FIXME
error_t IoGetRtcTimeChar(char *timeChar)
char* IoGetRtcTimeChar(void)
{
Time_t *RtcTime = IoGetRtcTime();
sprintf(timeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd",
sprintf(IoTimeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd",
RtcTime->day,
RtcTime->month,
RtcTime->year + RtcTime->century*100,
@ -172,9 +172,8 @@ error_t IoGetRtcTimeChar(char *timeChar)
RtcTime->min,
RtcTime->sec
);
return EOK;
return IoTimeChar;
}
// END OF FIXME XXX FIXME
static void UpdateRtcTime(void)