From 6d74608aff3f7623cdf63a509d9def131e66b956 Mon Sep 17 00:00:00 2001
From: barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>
Date: Sat, 1 Nov 2014 18:51:06 +0000
Subject: RTCv2. Alarm numbering now uses more intuitive scheme (starting from
 0).

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7453 35acf78f-673a-0410-8e92-d51de3d6d3f4
---
 os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
index 79b4268ca..0fc75de6c 100644
--- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
+++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c
@@ -334,7 +334,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
   /* Entering a reentrant critical zone.*/
   sts = chSysGetStatusAndLockX();
 
-  if (alarm == 1) {
+  if (alarm == 0) {
     if (alarmspec != NULL) {
       rtcp->rtc->CR &= ~RTC_CR_ALRAE;
       while (!(rtcp->rtc->ISR & RTC_ISR_ALRAWF))
@@ -383,7 +383,7 @@ void rtc_lld_get_alarm(RTCDriver *rtcp,
                        rtcalarm_t alarm,
                        RTCAlarm *alarmspec) {
 
-  if (alarm == 1)
+  if (alarm == 0)
     alarmspec->alrmr = rtcp->rtc->ALRMAR;
 #if RTC_ALARMS > 1
   else
-- 
cgit v1.2.3