diff --git a/components/drivers/include/drivers/rtc.h b/components/drivers/include/drivers/rtc.h index 0aacc4665f..9a9d9cefa3 100644 --- a/components/drivers/include/drivers/rtc.h +++ b/components/drivers/include/drivers/rtc.h @@ -38,6 +38,9 @@ struct rt_rtc_wkalarm rt_int32_t tm_sec; /* alarm at tm_sec */ rt_int32_t tm_min; /* alarm at tm_min */ rt_int32_t tm_hour; /* alarm at tm_hour */ + rt_int32_t tm_mday; /* alarm at tm_mday */ + rt_int32_t tm_mon; /* alarm at tm_mon */ + rt_int32_t tm_year; /* alarm at tm_year */ }; struct rt_rtc_ops diff --git a/components/drivers/rtc/alarm.c b/components/drivers/rtc/alarm.c index 6b89d9d1a3..62cb71ae7c 100644 --- a/components/drivers/rtc/alarm.c +++ b/components/drivers/rtc/alarm.c @@ -57,6 +57,9 @@ static rt_err_t alarm_set(struct rt_alarm *alarm) wkalarm.tm_sec = alarm->wktime.tm_sec; wkalarm.tm_min = alarm->wktime.tm_min; wkalarm.tm_hour = alarm->wktime.tm_hour; + wkalarm.tm_mday = alarm->wktime.tm_mday; + wkalarm.tm_mon = alarm->wktime.tm_mon; + wkalarm.tm_year = alarm->wktime.tm_year ret = rt_device_control(device, RT_DEVICE_CTRL_RTC_SET_ALARM, &wkalarm); if ((ret == RT_EOK) && wkalarm.enable) @@ -71,6 +74,9 @@ static rt_err_t alarm_set(struct rt_alarm *alarm) alarm->wktime.tm_sec = wkalarm.tm_sec; alarm->wktime.tm_min = wkalarm.tm_min; alarm->wktime.tm_hour = wkalarm.tm_hour; + alarm->wktime.tm_mday = wkalarm.tm_mday; + alarm->wktime.tm_mon = wkalarm.tm_mon; + alarm->wktime.tm_year = wkalarm.tm_year; } }