From f9ff7316d5c7277eb7482e30121388cd65f4ecfc Mon Sep 17 00:00:00 2001 From: nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> Date: Wed, 5 Dec 2018 22:31:01 +0800 Subject: Remove uses of INVALID_ defines, clean up some arrays with constants, and spaces -> tabs --- src/rtc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rtc.c') diff --git a/src/rtc.c b/src/rtc.c index 7553d7629..3f413d0e3 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -46,12 +46,12 @@ void RtcRestoreInterrupts(void) u32 ConvertBcdToBinary(u8 bcd) { if (bcd > 0x9F) - return INVALID_U8; + return 0xFF; if ((bcd & 0xF) <= 9) return (10 * ((bcd >> 4) & 0xF)) + (bcd & 0xF); else - return INVALID_U8; + return 0xFF; } bool8 IsLeapYear(u32 year) @@ -166,17 +166,17 @@ u16 RtcCheckInfo(struct SiiRtcInfo *rtc) year = ConvertBcdToBinary(rtc->year); - if (year == INVALID_U8) + if (year == 0xFF) errorFlags |= RTC_ERR_INVALID_YEAR; month = ConvertBcdToBinary(rtc->month); - if (month == INVALID_U8 || month == 0 || month > 12) + if (month == 0xFF || month == 0 || month > 12) errorFlags |= RTC_ERR_INVALID_MONTH; value = ConvertBcdToBinary(rtc->day); - if (value == INVALID_U8) + if (value == 0xFF) errorFlags |= RTC_ERR_INVALID_DAY; if (month == MONTH_FEB) -- cgit v1.2.3