From ae95f6cdfdd0ef0301a5d5b9f7224f276a408665 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 3 Apr 2016 09:52:25 -0600 Subject: [PATCH] RTC: Fix some errors when RTC debug is enabled --- arch | 2 +- drivers/timers/rtc.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch b/arch index 68a1918ab4..c71c24971d 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 68a1918ab42332510feca0a2203b768c7bb0c792 +Subproject commit c71c24971d1ff233a59a85c7ad65c81bdaeaa60b diff --git a/drivers/timers/rtc.c b/drivers/timers/rtc.c index 355f41a7ee..ae1bd96899 100644 --- a/drivers/timers/rtc.c +++ b/drivers/timers/rtc.c @@ -175,7 +175,7 @@ static void rtc_alarm_callback(FAR void *priv, int alarmid) FAR struct rtc_upperhalf_s *upper = (FAR struct rtc_upperhalf_s *)priv; FAR struct rtc_alarminfo_s *alarminfo; - DEBUGASSERT(upper != NULL && id >=0 && ID < CONFIG_RTC_NALARMS); + DEBUGASSERT(upper != NULL && alarmid >= 0 && alarmid < CONFIG_RTC_NALARMS); alarminfo = &upper->alarminfo[alarmid]; /* Do we think that the alaram is active? It might be due to some @@ -365,7 +365,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(alarminfo != NULL); alarmid = alarminfo->id; - DEBUGASSERT(alarmid >= 0 && alarmid < RTC_NALARMS); + DEBUGASSERT(alarmid >= 0 && alarmid < CONFIG_RTC_NALARMS); /* Is the alarm active? */ @@ -428,7 +428,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(alarminfo != NULL); alarmid = alarminfo->id; - DEBUGASSERT(alarmid >= 0 && alarmid < RTC_NALARMS); + DEBUGASSERT(alarmid >= 0 && alarmid < CONFIG_RTC_NALARMS); /* Is the alarm active? */ @@ -484,7 +484,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { int alarmid = (int)arg; - DEBUGASSERT(alarmid >= 0 && alarmid < RTC_NALARMS); + DEBUGASSERT(alarmid >= 0 && alarmid < CONFIG_RTC_NALARMS); if (ops->cancelalarm) { ret = ops->cancelalarm(upper->lower, alarmid);