I think I found some broken code in the GHI.OSHW.Hardware project: Getting the RTC time on my Cerbuino caused some exceptions. After some debugging I change some code in the OSHW hardware and now reading the RTC is fine:
private static DateTime GetTimeCerb()
{
Cerb.RTC_GetTime();
Cerb.RTC_GetDate();
// The following line in the commet contains a bug that might throw an argument exception:
// return new DateTime((Cerb.RTC_Year + 1980), Cerb.RTC_Month, Cerb.RTC_WeekDay, Cerb.RTC_Hours, Cerb.RTC_Minutes, Cerb.RTC_Seconds, Cerb.RTC_H12);
// It has been replaced by:
return new DateTime(Cerb.RTC_Year + 1980, Cerb.RTC_Month, Cerb.RTC_Date, Cerb.RTC_Hours, Cerb.RTC_Minutes, Cerb.RTC_Seconds );
}
Can somebody review my change and give some advise if the change is correct how to propagate this into the next version of GHI.OSHW.Hardware library?