Fix warnings and errors found by the new cppcheck provided static code analysis.

This commit is contained in:
Dean Camera 2012-02-28 20:40:24 +00:00
parent b762780343
commit bb85d083a7
7 changed files with 23 additions and 29 deletions

View file

@ -9,10 +9,7 @@
bool DS1307_SetTimeDate(const TimeDate_t* NewTimeDate)
{
#if defined(DUMMY_RTC)
return true;
#endif
#if !defined(DUMMY_RTC)
DS1307_DateTimeRegs_t NewRegValues;
const uint8_t WriteAddress = 0;
@ -41,6 +38,7 @@ bool DS1307_SetTimeDate(const TimeDate_t* NewTimeDate)
{
return false;
}
#endif
return true;
}
@ -55,10 +53,7 @@ bool DS1307_GetTimeDate(TimeDate_t* const TimeDate)
TimeDate->Day = 1;
TimeDate->Month = 1;
TimeDate->Year = 1;
return true;
#endif
#else
DS1307_DateTimeRegs_t CurrentRegValues;
const uint8_t ReadAddress = 0;
@ -78,6 +73,7 @@ bool DS1307_GetTimeDate(TimeDate_t* const TimeDate)
TimeDate->Day = (CurrentRegValues.Byte5.Fields.TenDay * 10) + CurrentRegValues.Byte5.Fields.Day;
TimeDate->Month = (CurrentRegValues.Byte6.Fields.TenMonth * 10) + CurrentRegValues.Byte6.Fields.Month;
TimeDate->Year = (CurrentRegValues.Byte7.Fields.TenYear * 10) + CurrentRegValues.Byte7.Fields.Year;
#endif
return true;
}