RTC
This commit is contained in:
parent
edcbbf966c
commit
272a0f243e
|
@ -39,6 +39,6 @@ extern void IoEnableRtc(void);
|
||||||
extern void IoPrintRtcTime(void);
|
extern void IoPrintRtcTime(void);
|
||||||
extern ulong IoGetRtcTicks(void);
|
extern ulong IoGetRtcTicks(void);
|
||||||
extern Time_t* IoGetRtcTime(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"};
|
//static char* WeekDays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
|
||||||
|
|
||||||
|
|
|
@ -94,17 +94,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
||||||
/* i++; */
|
/* i++; */
|
||||||
/* } */
|
/* } */
|
||||||
|
|
||||||
char cc[255];
|
KernLog("Goodbye at %s", IoGetRtcTimeChar());
|
||||||
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);
|
|
||||||
|
|
||||||
// End this machine's suffering
|
// End this machine's suffering
|
||||||
BStdOut->flusher(BStdOut);
|
BStdOut->flusher(BStdOut);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <kernel/time.h>
|
#include <kernel/time.h>
|
||||||
|
|
||||||
static ulong IoRtcTicks = 0;
|
static ulong IoRtcTicks = 0;
|
||||||
|
static char IoTimeChar[22] = { 0 };
|
||||||
static uchar RtcRate = 0x05; //2048Hz
|
static uchar RtcRate = 0x05; //2048Hz
|
||||||
static Time_t IoRtcOriginTime;
|
static Time_t IoRtcOriginTime;
|
||||||
static Time_t IoRtcTime;
|
static Time_t IoRtcTime;
|
||||||
|
@ -160,11 +161,10 @@ void IoPrintRtcTime(void)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME XXX FIXME
|
char* IoGetRtcTimeChar(void)
|
||||||
error_t IoGetRtcTimeChar(char *timeChar)
|
|
||||||
{
|
{
|
||||||
Time_t *RtcTime = IoGetRtcTime();
|
Time_t *RtcTime = IoGetRtcTime();
|
||||||
sprintf(timeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd",
|
sprintf(IoTimeChar, "%hhd/%hhd/%hd ; %hhd:%hhd:%hhd",
|
||||||
RtcTime->day,
|
RtcTime->day,
|
||||||
RtcTime->month,
|
RtcTime->month,
|
||||||
RtcTime->year + RtcTime->century*100,
|
RtcTime->year + RtcTime->century*100,
|
||||||
|
@ -172,9 +172,8 @@ error_t IoGetRtcTimeChar(char *timeChar)
|
||||||
RtcTime->min,
|
RtcTime->min,
|
||||||
RtcTime->sec
|
RtcTime->sec
|
||||||
);
|
);
|
||||||
return EOK;
|
return IoTimeChar;
|
||||||
}
|
}
|
||||||
// END OF FIXME XXX FIXME
|
|
||||||
|
|
||||||
|
|
||||||
static void UpdateRtcTime(void)
|
static void UpdateRtcTime(void)
|
||||||
|
|
Loading…
Reference in New Issue