From 5c1c5079eaec0330d339fa64e4d9c7245f2a83fe Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 8 May 2016 01:40:31 -0600 Subject: [PATCH] Cosmetic changes from review of last PR --- arch/arm/src/stm32l4/stm32l4_exti_alarm.c | 8 -------- arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c | 10 +++++----- arch/arm/src/stm32l4/stm32l4_rtcc.c | 13 ++++++------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/arch/arm/src/stm32l4/stm32l4_exti_alarm.c b/arch/arm/src/stm32l4/stm32l4_exti_alarm.c index 2935cacef8..c71d975283 100644 --- a/arch/arm/src/stm32l4/stm32l4_exti_alarm.c +++ b/arch/arm/src/stm32l4/stm32l4_exti_alarm.c @@ -54,10 +54,6 @@ #include "stm32l4_gpio.h" #include "stm32l4_exti.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -66,10 +62,6 @@ static xcpt_t stm32l4_exti_callback; -/**************************************************************************** - * Public Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c index bb0b7551fd..558aa2533b 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c +++ b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c @@ -100,6 +100,7 @@ struct stm32l4_lowerhalf_s /**************************************************************************** * Private Function Prototypes ****************************************************************************/ + /* Prototypes for static methods in struct rtc_ops_s */ static int stm32l4_rdtime(FAR struct rtc_lowerhalf_s *lower, @@ -179,7 +180,7 @@ static void stm32l4_alarm_callback(FAR void *arg, unsigned int alarmid) lower = (struct stm32l4_lowerhalf_s *)arg; cbinfo = &lower->cbinfo[alarmid]; - /* Sample and clear the callback information to minimize the window in + /* Sample and clear the callback information to minimize the window in * time in which race conditions can occur. */ @@ -195,7 +196,6 @@ static void stm32l4_alarm_callback(FAR void *arg, unsigned int alarmid) { cb(priv, alarmid); } - } #endif /* CONFIG_RTC_ALARM */ @@ -298,7 +298,7 @@ static int stm32l4_settime(FAR struct rtc_lowerhalf_s *lower, #ifdef CONFIG_RTC_ALARM static int stm32l4_setalarm(FAR struct rtc_lowerhalf_s *lower, - FAR const struct lower_setalarm_s *alarminfo) + FAR const struct lower_setalarm_s *alarminfo) { FAR struct stm32l4_lowerhalf_s *priv; FAR struct stm32l4_cbinfo_s *cbinfo; @@ -367,7 +367,7 @@ static int stm32l4_setalarm(FAR struct rtc_lowerhalf_s *lower, #ifdef CONFIG_RTC_ALARM static int stm32l4_setrelative(FAR struct rtc_lowerhalf_s *lower, - FAR const struct lower_setrelative_s *alarminfo) + FAR const struct lower_setrelative_s *alarminfo) { struct lower_setalarm_s setalarm; struct tm time; @@ -380,7 +380,7 @@ static int stm32l4_setrelative(FAR struct rtc_lowerhalf_s *lower, if ((alarminfo->id == RTC_ALARMA || alarminfo->id == RTC_ALARMB) && alarminfo->reltime > 0) { - /* Disable preemption while we do this so that we don't have to worry + /* Disable pre-emption while we do this so that we don't have to worry * about being suspended and working on an old time. */ diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index 5dacc7a62d..eab4fa45e8 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -112,7 +112,8 @@ (rtc_bin2bcd((tm)->tm_min) << RTC_ALRMR_MNU_SHIFT) | \ (rtc_bin2bcd((tm)->tm_hour) << RTC_ALRMR_HU_SHIFT)) -/* need to ignore DATE/DOW part of alarm; rtc_reg_alrmr_bin2bcd only encodes hms */ +/* Need to ignore DATE/DOW part of alarm; rtc_reg_alrmr_bin2bcd only encodes hms */ + #define RTC_ALRMR_ENABLE (0x80000000) /* Debug ****************************************************************************/ @@ -995,8 +996,6 @@ int up_rtc_initialize(void) return OK; } - - /************************************************************************************ * Name: stm32l4_rtc_getdatetime_with_subseconds * @@ -1324,7 +1323,7 @@ int stm32l4_rtc_setalarm(FAR struct alm_setalarm_s *alminfo) * Name: stm32l4_rtc_cancelalarm * * Description: - * Cancel an alaram. + * Cancel an alarm. * * Input Parameters: * alarmid - Identifies the alarm to be cancelled @@ -1378,7 +1377,7 @@ int stm32l4_rtc_cancelalarm(enum alm_id_e alarmid) break; case RTC_ALARMB: - { + { /* Cancel the global callback function */ g_alarmcb[alarmid].ac_cb = NULL; @@ -1405,8 +1404,8 @@ int stm32l4_rtc_cancelalarm(enum alm_id_e alarmid) putreg32(-1, STM32L4_RTC_ALRMBR); modifyreg32(STM32L4_RTC_ISR, RTC_ISR_ALRBF, 0); rtc_wprlock(); - ret = OK; - } + ret = OK; + } break; default: