git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7360 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2014-10-04 08:09:17 +00:00
parent c74da79d45
commit de71c96d0c
3 changed files with 13 additions and 8 deletions

View File

@ -180,7 +180,7 @@ extern "C" {
void rtcInit(void);
void rtcSetTime(RTCDriver *rtcp, const RTCDateTime *timespec);
void rtcGetTime(RTCDriver *rtcp, RTCDateTime *timespec);
#if STM32_RTC_NUM_ALARMS > 0
#if RTC_ALARMS > 0
void rtcSetAlarm(RTCDriver *rtcp,
rtcalarm_t alarm,
const RTCAlarm *alarmspec);

View File

@ -302,7 +302,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
rtc_decode_date(rtcp->rtc->DR, timespec);
}
#if (STM32_RTC_NUM_ALARMS > 0) || defined(__DOXYGEN__)
#if (RTC_ALARMS > 0) || defined(__DOXYGEN__)
/**
* @brief Set alarm time.
*
@ -333,7 +333,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
rtcp->rtc->CR &= ~RTC_CR_ALRAE;
}
}
#if STM32_RTC_NUM_ALARMS > 1
#if RTC_ALARMS > 1
else {
if (alarmspec != NULL) {
rtcp->rtc->CR &= ~RTC_CR_ALRBE;
@ -348,7 +348,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
rtcp->rtc->CR &= ~RTC_CR_ALRBE;
}
}
#endif /* STM32_RTC_NUM_ALARMS > 1 */
#endif /* RTC_ALARMS > 1 */
}
/**
@ -365,12 +365,12 @@ void rtc_lld_get_alarm(RTCDriver *rtcp,
RTCAlarm *alarmspec) {
if (alarm == 1)
alarmspec->alrmr = rtcp->rtc->ALRMAR;
#if STM32_RTC_NUM_ALARMS > 1
#if RTC_ALARMS > 1
else
alarmspec->alrmr = rtcp->rtc->ALRMBR;
#endif /* STM32_RTC_NUM_ALARMS > 1 */
#endif /* RTC_ALARMS > 1 */
}
#endif /* STM32_RTC_NUM_ALARMS > 0 */
#endif /* RTC_ALARMS > 0 */
#if STM32_RTC_HAS_PERIODIC_WAKEUPS || defined(__DOXYGEN__)

View File

@ -40,6 +40,11 @@
*/
#define RTC_SUPPORTS_CALLBACKS STM32_RTC_HAS_INTERRUPTS
/**
* @brief Number of alarms available.
*/
#define RTC_ALARMS STM32_RTC_NUM_ALARMS
/**
* @brief RTC PRER register initializer.
*/
@ -173,7 +178,7 @@ extern "C" {
void rtc_lld_init(void);
void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec);
void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec);
#if STM32_RTC_NUM_ALARMS > 0
#if RTC_ALARMS > 0
void rtc_lld_set_alarm(RTCDriver *rtcp,
rtcalarm_t alarm,
const RTCAlarm *alarmspec);