diff options
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c | 14 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c index 78727af35c..b8e7adbccd 100644 --- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c +++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/clock.c @@ -171,7 +171,7 @@ void rtcGetTimeAndDate(uint8 * time) { void rtcSetTimeAndDate(uint8 * time) { //--------------------------------------------------------------------------------- uint8 command[8]; - + int i; for ( i=0; i< 8; i++ ) { command[i+1] = time[i]; @@ -204,7 +204,7 @@ void rtcGetTime(uint8 * time) { void rtcSetTime(uint8 * time) { //--------------------------------------------------------------------------------- uint8 command[4]; - + int i; for ( i=0; i< 3; i++ ) { command[i+1] = time[i]; @@ -226,7 +226,7 @@ void syncRTC() { } } } - + IPC->unixTime++; } @@ -246,11 +246,11 @@ void initClockIRQ() { command[0] = WRITE_STATUS_REG2; command[1] = 0x41; rtcTransaction(command, 2, 0, 0); - + command[0] = WRITE_INT_REG1; command[1] = 0x01; rtcTransaction(command, 2, 0, 0); - + command[0] = WRITE_INT_REG2; command[1] = 0x00; command[2] = 0x21; @@ -270,9 +270,9 @@ void initClockIRQ() { currentTime.tm_mday = IPC->time.rtc.day; currentTime.tm_mon = IPC->time.rtc.month - 1; currentTime.tm_year = IPC->time.rtc.year + 100; - + currentTime.tm_isdst = -1; - + IPC->unixTime = mktime(¤tTime); } diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c index 11c25cb03c..a62b6bf8b4 100644 --- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c +++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/touch.c @@ -94,7 +94,7 @@ uint16 touchRead(uint32 command) { uint32 oldIME = REG_IME; REG_IME = 0; - + SerialWaitBusy(); // Write the command and wait for it to complete diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c index 8e92cb2b79..4aa7a8f7e8 100644 --- a/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c +++ b/c/src/lib/libbsp/arm/nds/libnds/source/arm7/userSettings.c @@ -39,10 +39,10 @@ void readUserSettings() { uint32 userSettingsBase; readFirmware( 0x20, &userSettingsBase,2); - + uint32 slot1Address = userSettingsBase * 8; uint32 slot2Address = userSettingsBase * 8 + 0x100; - + readFirmware( slot1Address , &slot1, sizeof(PERSONAL_DATA)); readFirmware( slot2Address , &slot2, sizeof(PERSONAL_DATA)); readFirmware( slot1Address + 0x70, &slot1count, 2); @@ -52,20 +52,20 @@ void readUserSettings() { // default to slot 1 user Settings void *currentSettings = &slot1; - + short calc1CRC = swiCRC16( 0xffff, &slot1, sizeof(PERSONAL_DATA)); short calc2CRC = swiCRC16( 0xffff, &slot2, sizeof(PERSONAL_DATA)); // bail out if neither slot is valid if ( calc1CRC != slot1CRC && calc2CRC != slot2CRC) return; - + // if both slots are valid pick the most recent - if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) { + if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) { currentSettings = (slot2count == (( slot2count + 1 ) & 0x7f) ? &slot2 : &slot1); } else { if ( calc2CRC == slot2CRC ) currentSettings = &slot2; } memcpy ( PersonalData, currentSettings, sizeof(PERSONAL_DATA)); - + } |