summaryrefslogtreecommitdiff
path: root/src/rtc.c
diff options
context:
space:
mode:
authornullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-11-29 19:24:28 +0800
committernullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com>2018-12-06 09:44:08 +0800
commit3909b6408c0125fe311d49a3029a2806993615f7 (patch)
treea02365a6eb268dce08941968e11e319f3a7fe080 /src/rtc.c
parent1b33ad6c26fa83aa7b77055ddde59c61df03d0e4 (diff)
Fix alloc.c as per #386, define INVALID_ constants and rename malloc to alloc as per #325
Some of the INVALID_ are likely erroneously placed, due to lack of documentation
Diffstat (limited to 'src/rtc.c')
-rw-r--r--src/rtc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rtc.c b/src/rtc.c
index 3f413d0e3..7553d7629 100644
--- a/src/rtc.c
+++ b/src/rtc.c
@@ -46,12 +46,12 @@ void RtcRestoreInterrupts(void)
u32 ConvertBcdToBinary(u8 bcd)
{
if (bcd > 0x9F)
- return 0xFF;
+ return INVALID_U8;
if ((bcd & 0xF) <= 9)
return (10 * ((bcd >> 4) & 0xF)) + (bcd & 0xF);
else
- return 0xFF;
+ return INVALID_U8;
}
bool8 IsLeapYear(u32 year)
@@ -166,17 +166,17 @@ u16 RtcCheckInfo(struct SiiRtcInfo *rtc)
year = ConvertBcdToBinary(rtc->year);
- if (year == 0xFF)
+ if (year == INVALID_U8)
errorFlags |= RTC_ERR_INVALID_YEAR;
month = ConvertBcdToBinary(rtc->month);
- if (month == 0xFF || month == 0 || month > 12)
+ if (month == INVALID_U8 || month == 0 || month > 12)
errorFlags |= RTC_ERR_INVALID_MONTH;
value = ConvertBcdToBinary(rtc->day);
- if (value == 0xFF)
+ if (value == INVALID_U8)
errorFlags |= RTC_ERR_INVALID_DAY;
if (month == MONTH_FEB)