Index: firmware/common/timefuncs.c =================================================================== --- firmware/common/timefuncs.c (revisione 23221) +++ firmware/common/timefuncs.c (copia locale) @@ -62,6 +62,8 @@ { #if CONFIG_RTC static long timeout = 0; + static int m_to_d[12] = + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; /* Don't read the RTC more than once per second */ if (current_tick > timeout) @@ -70,7 +72,11 @@ timeout = HZ * (current_tick / HZ + 1) + HZ / 5; rtc_read_datetime(&tm); - tm.tm_yday = 0; /* Not implemented for now */ + tm.tm_yday = m_to_d[tm.tm_mon] + tm.tm_mday; + if(tm.tm_mon > 1) /* check to see if its a leap year */ + if((!((tm.tm_year + 1900) % 4) && ((tm.tm_year + 1900) % 100)) || !((tm.tm_year + 1900) % 400)) + tm.tm_yday += 1; + tm.tm_isdst = -1; /* Not implemented for now */ } #else /* No RTC */