aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-19 09:49:12 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-03-19 09:49:12 +0000
commit24204f0de857df608d949f9d5f262f5df1e9bc2d (patch)
tree45c86f98cf31cfdf99c5aaea74d8301c43ad49e1
parent13364b3ca951146a39a3f03ec7b6b36ca929d4bd (diff)
downloadChibiOS-24204f0de857df608d949f9d5f262f5df1e9bc2d.tar.gz
ChibiOS-24204f0de857df608d949f9d5f262f5df1e9bc2d.tar.bz2
ChibiOS-24204f0de857df608d949f9d5f262f5df1e9bc2d.zip
Fixed bug #475.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6785 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/platforms/STM32/RTCv2/rtc_lld.c24
-rw-r--r--os/hal/platforms/STM32/RTCv2/rtc_lld.h2
-rw-r--r--readme.txt2
3 files changed, 16 insertions, 12 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
index f663ecd3b..f6ad340fe 100644
--- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c
+++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
@@ -20,7 +20,7 @@
/**
* @file STM32/RTCv2/rtc_lld.c
- * @brief STM32L1xx/STM32F2xx/STM32F4xx RTC low level driver.
+ * @brief RTC low level driver.
*
* @addtogroup RTC
* @{
@@ -64,10 +64,10 @@ RTCDriver RTCD1;
*
* @notapi
*/
-#define rtc_lld_enter_init() { \
- RTCD1.id_rtc->ISR |= RTC_ISR_INIT; \
- while ((RTCD1.id_rtc->ISR & RTC_ISR_INITF) == 0) \
- ; \
+#define rtc_lld_enter_init() { \
+ RTCD1.id_rtc->ISR |= RTC_ISR_INIT; \
+ while ((RTCD1.id_rtc->ISR & RTC_ISR_INITF) == 0) \
+ ; \
}
/**
@@ -164,16 +164,17 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCTime *timespec) {
* @note Default value after BKP domain reset for both comparators is 0.
* @note Function does not performs any checks of alarm time validity.
*
- * @param[in] rtcp Pointer to RTC driver structure.
- * @param[in] alarm Alarm identifier. Can be 1 or 2.
- * @param[in] alarmspec Pointer to a @p RTCAlarm structure.
+ * @param[in] rtcp pointer to RTC driver structure
+ * @param[in] alarm alarm identifier starting from zero
+ * @param[in] alarmspec pointer to a @p RTCAlarm structure
*
* @api
*/
void rtc_lld_set_alarm(RTCDriver *rtcp,
rtcalarm_t alarm,
const RTCAlarm *alarmspec) {
- if (alarm == 1){
+
+ if (alarm == 0) {
if (alarmspec != NULL){
rtcp->id_rtc->CR &= ~RTC_CR_ALRAE;
while(!(rtcp->id_rtc->ISR & RTC_ISR_ALRAWF))
@@ -209,7 +210,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
* @brief Get alarm time.
*
* @param[in] rtcp pointer to RTC driver structure
- * @param[in] alarm alarm identifier
+ * @param[in] alarm alarm identifier starting from zero
* @param[out] alarmspec pointer to a @p RTCAlarm structure
*
* @api
@@ -217,7 +218,8 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
void rtc_lld_get_alarm(RTCDriver *rtcp,
rtcalarm_t alarm,
RTCAlarm *alarmspec) {
- if (alarm == 1)
+
+ if (alarm == 0)
alarmspec->tv_datetime = rtcp->id_rtc->ALRMAR;
#if RTC_ALARMS == 2
else
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.h b/os/hal/platforms/STM32/RTCv2/rtc_lld.h
index ef96b777e..78be00c69 100644
--- a/os/hal/platforms/STM32/RTCv2/rtc_lld.h
+++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.h
@@ -20,7 +20,7 @@
/**
* @file STM32/RTCv2/rtc_lld.h
- * @brief STM32L1xx/STM32F2xx/STM32F4xx RTC low level driver header.
+ * @brief RTC low level driver header.
*
* @addtogroup RTC
* @{
diff --git a/readme.txt b/readme.txt
index fef427a81..f2caa5e3a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -89,6 +89,8 @@
*****************************************************************************
*** 2.7.0 ***
+- FIX: Fixed wrong STM32 RTCv2 alarms implementation (bug #475)(backported
+ to 2.6.4).
- FIX: Fixed wrong ADC34 macros in STM32F30x HAL driver (bug #474)
(backported to 2.6.4).
- FIX: Fixed wrong TIM1 and TIM8 macros in STM32F30x HAL driver (bug #473)