2008-09-17 13:29:00 RTC_ISTAT_ALARM_DAY in BF537
Alex Pereira (BRAZIL)
Message: 62325
I'm trying to setup my board to schedule an alarm to happen in a specific date/time by using BF537 RTC features. I've understood pretty well the uClinux RTC subsystem and stopped at a question I could not solve by myself.
See in rtc-dev.c file, tm_yday is set to -1:
static int rtc_dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
...
case RTC_ALM_SET:
...
alarm.time.tm_yday = -1;
...
}
And in file rtc-bfin.c it is verifyied if tm_yday == -1:
static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
{
...
case RTC_AIE_ON: {
...
if (rtc->rtc_alarm.tm_yday == -1) {
....
which_alarm = RTC_ISTAT_ALARM;
} else {
ret = rtc_tm_to_time(&rtc->rtc_alarm, &rtc_alarm);
which_alarm = RTC_ISTAT_ALARM_DAY;
}
}
Then, I would say if I try to schedule an ALARM_DAY (date and time), by using such sorcecode, it will never schedule correctly. Am I right?
Thanks,
Alex
QuoteReplyEditDelete
2008-09-17 13:48:37 Re: RTC_ISTAT_ALARM_DAY in BF537
Mike Frysinger (UNITED STATES)
Message: 62326
rather than focusing on the implementation, the user api docs explains things. RTC_ALM_SET does not support dates, only time. if you want dates, you need to use RTC_WKALM_SET.
QuoteReplyEditDelete
2008-09-18 13:41:09 Re: RTC_ISTAT_ALARM_DAY in BF537
Alex Pereira (BRAZIL)
Message: 62396
Mike,
The RTC_WKALM_SET worked fine.
Thank you,
Alex