diff options
author | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-05 22:31:01 +0800 |
---|---|---|
committer | nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> | 2018-12-06 10:38:28 +0800 |
commit | f9ff7316d5c7277eb7482e30121388cd65f4ecfc (patch) | |
tree | ee8f4a9c338f880a3585d6e9ed9ed695f27cef3d /src/rtc.c | |
parent | 405f1bb529809b8169364737087189df0fcca1d2 (diff) |
Remove uses of INVALID_ defines, clean up some arrays with constants, and spaces -> tabs
Diffstat (limited to 'src/rtc.c')
-rw-r--r-- | src/rtc.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) |