summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-04-05 20:51:34 -0700
committerYamaArashi <shadow962@live.com>2016-04-05 20:51:34 -0700
commite0e5cb9ce6e3e43309a43ad3cca8ec8b1a1d6f99 (patch)
treeb10fa62dc497a26de5da36f21f3f8ec92b424406
parent590888bf2791f5a800446c6908de0ab7c7c5035a (diff)
small string/RTC code changes
-rw-r--r--data/rtc_util.s3
-rw-r--r--include/rtc_util.h2
-rw-r--r--src/rtc_util.c6
-rw-r--r--src/string_util.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/data/rtc_util.s b/data/rtc_util.s
index 9ee05f47e..599f4e001 100644
--- a/data/rtc_util.s
+++ b/data/rtc_util.s
@@ -1,7 +1,8 @@
.align 2
+; Dummy values used when the RTC is in an invalid state.
; 2000 Jan 1 00:00:00
-gDefaultRtcInfo: ; 81E7610
+gRtcDummy: ; 81E7610
.byte 0
.byte 1
.byte 1
diff --git a/include/rtc_util.h b/include/rtc_util.h
index 039d7e4fd..96d7e716b 100644
--- a/include/rtc_util.h
+++ b/include/rtc_util.h
@@ -15,7 +15,7 @@
#define RTC_ERR_INVALID_MINUTE 0x0400
#define RTC_ERR_INVALID_SECOND 0x0800
-#define RTC_ERROR_FLAGS 0x0FF0
+#define RTC_ERR_FLAG_MASK 0x0FF0
void RtcInit();
u16 RtcGetErrorStatus();
diff --git a/src/rtc_util.c b/src/rtc_util.c
index 940b1fea9..876d4ab24 100644
--- a/src/rtc_util.c
+++ b/src/rtc_util.c
@@ -3,7 +3,7 @@
#include "rtc_util.h"
#include "string_util.h"
-extern const struct SiiRtcInfo gDefaultRtcInfo;
+extern const struct SiiRtcInfo gRtcDummy;
extern const s32 gNumDaysInMonths[];
extern u16 gRtcErrorStatus;
@@ -133,8 +133,8 @@ u16 RtcGetErrorStatus()
void RtcGetInfo(struct SiiRtcInfo *rtc)
{
- if (gRtcErrorStatus & RTC_ERROR_FLAGS)
- *rtc = gDefaultRtcInfo;
+ if (gRtcErrorStatus & RTC_ERR_FLAG_MASK)
+ *rtc = gRtcDummy;
else
RtcGetRawInfo(rtc);
}
diff --git a/src/string_util.c b/src/string_util.c
index a2d2d9cd2..05c415478 100644
--- a/src/string_util.c
+++ b/src/string_util.c
@@ -317,7 +317,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
}
else if (digit != 0 || powerOfSixteen == 1)
{
- state = 1;
+ state = WRITING_DIGITS;
out = dest++;
if (digit <= 0xF)