[stm32f1] 对于RTC-Alarm进行添加STM32F1宏控制 (#6765)
并确认并列出已经在什么情况或板卡上进行了测试。 And confirm in which case or board has been tested. --> STM32F103ZET6 为什么提交这份PR (why to submit this PR) 使用STM32F103ZET6的RTC的Alarm功能出现问题,按照原本的驱动代码编译会报错。 你的解决方案是什么 (what is your solution) 修改底层驱动drv_rtc.c文件,将报错的几个结构体给注释掉即可。 在什么测试环境下测试通过 (what is the test environment) rtstudio下对STM32F103ZET6进行测试并且成功运行Alarm功能
This commit is contained in:
parent
eec9d4f595
commit
f4323f2049
@ -368,14 +368,16 @@ static rt_err_t rtc_alarm_time_set(struct rtc_device_object* p_dev)
|
||||
if (p_dev->wkalarm.enable)
|
||||
{
|
||||
Alarm_InitStruct.Alarm = RTC_ALARM_A;
|
||||
Alarm_InitStruct.AlarmTime.Hours = p_dev->wkalarm.tm_hour;
|
||||
Alarm_InitStruct.AlarmTime.Minutes = p_dev->wkalarm.tm_min;
|
||||
Alarm_InitStruct.AlarmTime.Seconds = p_dev->wkalarm.tm_sec;
|
||||
#ifndef SOC_SERIES_STM32F1
|
||||
Alarm_InitStruct.AlarmDateWeekDay = RTC_WEEKDAY_MONDAY;
|
||||
Alarm_InitStruct.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_WEEKDAY;
|
||||
Alarm_InitStruct.AlarmMask = RTC_ALARMMASK_DATEWEEKDAY;
|
||||
Alarm_InitStruct.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE;
|
||||
Alarm_InitStruct.AlarmTime.TimeFormat = RTC_HOURFORMAT12_AM;
|
||||
Alarm_InitStruct.AlarmTime.Hours = p_dev->wkalarm.tm_hour;
|
||||
Alarm_InitStruct.AlarmTime.Minutes = p_dev->wkalarm.tm_min;
|
||||
Alarm_InitStruct.AlarmTime.Seconds = p_dev->wkalarm.tm_sec;
|
||||
#endif /* SOC_SERIES_STM32F1 */
|
||||
LOG_D("alarm set:%d:%d:%d", Alarm_InitStruct.AlarmTime.Hours,
|
||||
Alarm_InitStruct.AlarmTime.Minutes,
|
||||
Alarm_InitStruct.AlarmTime.Seconds);
|
||||
|
Loading…
x
Reference in New Issue
Block a user