From eb6fbc3059e3b8d02919acd40957f433626a92e9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Mar 2016 14:44:29 -0600 Subject: [PATCH] Trivial changes from review of last PR --- arch/arm/src/stm32l4/chip/stm32l4_rtcc.h | 3 +-- arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c | 14 ++++++-------- arch/arm/src/stm32l4/stm32l4_rtcc.c | 12 ++++-------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/arch/arm/src/stm32l4/chip/stm32l4_rtcc.h b/arch/arm/src/stm32l4/chip/stm32l4_rtcc.h index 7cb17c76bb..1bc7c7bfd7 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4_rtcc.h +++ b/arch/arm/src/stm32l4/chip/stm32l4_rtcc.h @@ -1,5 +1,5 @@ /************************************************************************************ - * arch/arm/src/stm32l4/chip/stm32l4_rtcc.h.h + * arch/arm/src/stm32l4/chip/stm32l4_rtcc.h * * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: dev@ziggurat29.com @@ -62,7 +62,6 @@ #define STM32L4_RTC_ALRMBSSR_OFFSET 0x0048 /* RTC alarm B sub second register */ #define STM32L4_RTC_OR_OFFSET 0x004c /* RTC option register */ - #define STM32L4_RTC_BKR_OFFSET(n) (0x0050+((n)<<2)) #define STM32L4_RTC_BK0R_OFFSET 0x0050 /* RTC backup register 0 */ #define STM32L4_RTC_BK1R_OFFSET 0x0054 /* RTC backup register 1 */ diff --git a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c index 57d92c3a1d..9da5c40aa8 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c +++ b/arch/arm/src/stm32l4/stm32l4_rtc_lowerhalf.c @@ -52,13 +52,10 @@ #ifdef CONFIG_RTC_DRIVER -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Types ****************************************************************************/ + /* This is the private type for the RTC state. It must be cast compatible * with struct rtc_lowerhalf_s. */ @@ -82,13 +79,14 @@ struct stm32l4_lowerhalf_s /* Prototypes for static methods in struct rtc_ops_s */ static int stm32l4_rdtime(FAR struct rtc_lowerhalf_s *lower, - FAR struct rtc_time *rtctime); + FAR struct rtc_time *rtctime); static int stm32l4_settime(FAR struct rtc_lowerhalf_s *lower, - FAR const struct rtc_time *rtctime); + FAR const struct rtc_time *rtctime); /**************************************************************************** * Private Data ****************************************************************************/ + /* STM32 RTC driver operations */ static const struct rtc_ops_s g_rtc_ops = @@ -156,7 +154,7 @@ static struct stm32l4_lowerhalf_s g_rtc_lowerhalf = ****************************************************************************/ static int stm32l4_rdtime(FAR struct rtc_lowerhalf_s *lower, - FAR struct rtc_time *rtctime) + FAR struct rtc_time *rtctime) { /* This operation depends on the fact that struct rtc_time is cast * compatible with struct tm. @@ -182,7 +180,7 @@ static int stm32l4_rdtime(FAR struct rtc_lowerhalf_s *lower, ****************************************************************************/ static int stm32l4_settime(FAR struct rtc_lowerhalf_s *lower, - FAR const struct rtc_time *rtctime) + FAR const struct rtc_time *rtctime) { /* This operation depends on the fact that struct rtc_time is cast * compatible with struct tm. diff --git a/arch/arm/src/stm32l4/stm32l4_rtcc.c b/arch/arm/src/stm32l4/stm32l4_rtcc.c index 13c2f14d8f..1b7bb5f12a 100644 --- a/arch/arm/src/stm32l4/stm32l4_rtcc.c +++ b/arch/arm/src/stm32l4/stm32l4_rtcc.c @@ -63,6 +63,7 @@ /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ + /* Configuration ********************************************************************/ /* This RTC implementation supports only date/time RTC hardware */ @@ -111,10 +112,6 @@ # define rtcllvdbg(x...) #endif -/************************************************************************************ - * Private Types - ************************************************************************************/ - /************************************************************************************ * Private Data ************************************************************************************/ @@ -136,6 +133,7 @@ volatile bool g_rtc_enabled = false; /************************************************************************************ * Private Functions ************************************************************************************/ + /************************************************************************************ * Name: rtc_dumpregs * @@ -222,8 +220,7 @@ static void rtc_dumptime(FAR const struct tm *tp, FAR const char *msg) static void rtc_wprunlock(void) { - /* Enable write access to the backup domain. - */ + /* Enable write access to the backup domain. */ (void)stm32l4_pwr_enablebkp(true); @@ -260,8 +257,7 @@ static inline void rtc_wprlock(void) putreg32(0xff, STM32L4_RTC_WPR); - /* Disable write access to the backup domain. - */ + /* Disable write access to the backup domain. */ (void)stm32l4_pwr_enablebkp(false); }