Patch by Erik Theisen, 23 Oct 2001
#include <command.h>
#include <rtc.h>
#include <config.h>
-#include "error.h"
#if defined(CONFIG_RTC_M48T35A) && (CONFIG_COMMANDS & CFG_CMD_DATE)
return (((n / 10) << 4) | (n % 10));
}
-#if 0
-int rtctest(void){
- struct rtc_time *tmp;
- uchar tchar;
-
- log_stat(ERR_RTCG);
- *(unsigned char *)(CFG_NVRAM_BASE_ADDR + CFG_NVRAM_SIZE - 9) = 0xaa;
- tchar = *(unsigned char *)(CFG_NVRAM_BASE_ADDR + CFG_NVRAM_SIZE - 9);
- tchar = tchar ^ 0xaa;
- if( tchar != 0xaa ) log_warn(ERR_RTCBAT);
- rtc_get(tmp);
- if((tmp->tm_sec > 59) |
- (tmp->tm_min > 59) |
- (tmp->tm_hour > 23) |
- (tmp->tm_mday < 1 ) | (tmp->tm_mday > 31) |
- (tmp->tm_mon < 1 ) | (tmp->tm_mon > 12) |
- (tmp->tm_year > 99) |
- (tmp->tm_wday < 1 ) | (tmp->tm_wday > 7 ) |
- (tmp->tm_wday < 1 ) | (tmp->tm_wday > 7 ) )
- {
- log_warn(ERR_RTCVAL);
- rtc_reset();
- return 0;
- }
- return 1;
-}
-#endif
-
#endif /* CONFIG_RTC_M48T35A && CFG_CMD_DATE */