arch/arm/src/stm32, stm32f7, stm32l4: Make STM32F4XX RTC depend on CONFIG_STM32_RTC, cosmetic changes to comments

This commit is contained in:
Juha Niskanen 2018-08-16 08:05:24 -06:00 committed by Gregory Nutt
parent abf251f2a9
commit c90ee015e4
5 changed files with 22 additions and 154 deletions

View File

@ -104,16 +104,6 @@ volatile bool g_rtc_enabled = false;
************************************************************************************/ ************************************************************************************/
/************************************************************************************ /************************************************************************************
* Name: rtc_dumpregs * Name: rtc_dumpregs
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -147,16 +137,6 @@ static void rtc_dumpregs(FAR const char *msg)
/************************************************************************************ /************************************************************************************
* Name: rtc_dumptime * Name: rtc_dumptime
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO

View File

@ -58,7 +58,7 @@
#include <arch/board/board.h> #include <arch/board/board.h>
#if defined(CONFIG_RTC) && !defined(CONFIG_RTC_EXTERNAL) #ifdef CONFIG_STM32_RTC
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
@ -167,16 +167,6 @@ static inline void rtc_enable_alarm(void);
/**************************************************************************** /****************************************************************************
* Name: rtc_dumpregs * Name: rtc_dumpregs
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -216,16 +206,6 @@ static void rtc_dumpregs(FAR const char *msg)
/**************************************************************************** /****************************************************************************
* Name: rtc_dumptime * Name: rtc_dumptime
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -751,9 +731,7 @@ static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg)
{ {
int ret = -EBUSY; int ret = -EBUSY;
/* Need to follow RTC register wrote protection /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -787,9 +765,7 @@ static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg)
{ {
int ret = -EBUSY; int ret = -EBUSY;
/* Need to follow RTC register wrote protection /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1319,7 +1295,7 @@ int stm32_rtc_setdatetime(FAR const struct tm *tp)
/* Then write the broken out values to the RTC */ /* Then write the broken out values to the RTC */
/* Convert the struct tm format to RTC time register fields. All of the STM32 /* Convert the struct tm format to RTC time register fields.
* All of the ranges of values correspond between struct tm and the time * All of the ranges of values correspond between struct tm and the time
* register. * register.
*/ */
@ -1537,9 +1513,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1569,9 +1543,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1607,7 +1579,7 @@ errout_with_wprunlock:
} }
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: stm32_rtc_rdalarm * Name: stm32_rtc_rdalarm
* *
* Description: * Description:
@ -1619,7 +1591,7 @@ errout_with_wprunlock:
* Returned Value: * Returned Value:
* Zero (OK) on success; a negated errno on failure * Zero (OK) on success; a negated errno on failure
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
int stm32_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo) int stm32_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo)
@ -1645,7 +1617,7 @@ int stm32_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo)
{ {
alarmreg = STM32_RTC_ALRMBR; alarmreg = STM32_RTC_ALRMBR;
ret = stm32_rtc_getalarmdatetime(alarmreg, ret = stm32_rtc_getalarmdatetime(alarmreg,
(struct tm *)alminfo->ar_time); (struct tm *)alminfo->ar_time);
} }
break; break;
#endif #endif
@ -1659,5 +1631,5 @@ int stm32_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo)
} }
#endif #endif
#endif /* CONFIG_RTC && !CONFIG_RTC_EXTERNAL */ #endif /* CONFIG_STM32_RTC */

View File

@ -170,16 +170,6 @@ static inline void rtc_enable_alarm(void);
/**************************************************************************** /****************************************************************************
* Name: rtc_dumpregs * Name: rtc_dumpregs
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -211,16 +201,6 @@ static void rtc_dumpregs(FAR const char *msg)
/**************************************************************************** /****************************************************************************
* Name: rtc_dumptime * Name: rtc_dumptime
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -685,9 +665,7 @@ static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -730,9 +708,7 @@ static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1510,9 +1486,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1543,9 +1517,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();

View File

@ -169,16 +169,6 @@ static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg);
/**************************************************************************** /****************************************************************************
* Name: rtc_dumpregs * Name: rtc_dumpregs
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -218,16 +208,6 @@ static void rtc_dumpregs(FAR const char *msg)
/**************************************************************************** /****************************************************************************
* Name: rtc_dumptime * Name: rtc_dumptime
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -767,9 +747,7 @@ static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -812,9 +790,7 @@ static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1581,9 +1557,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1614,9 +1588,7 @@ int stm32_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();

View File

@ -149,16 +149,6 @@ static inline void rtc_enable_alarm(void);
/**************************************************************************** /****************************************************************************
* Name: rtc_dumpregs * Name: rtc_dumpregs
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -190,16 +180,6 @@ static void rtc_dumpregs(FAR const char *msg)
/**************************************************************************** /****************************************************************************
* Name: rtc_dumptime * Name: rtc_dumptime
*
* Description:
* Disable RTC write protection
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_RTC_INFO #ifdef CONFIG_DEBUG_RTC_INFO
@ -664,9 +644,7 @@ static int rtchw_set_alrmar(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -709,9 +687,7 @@ static int rtchw_set_alrmbr(rtc_alarmreg_t alarmreg)
int isr; int isr;
int ret = -EBUSY; int ret = -EBUSY;
/* Need to allow RTC register write /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1467,9 +1443,7 @@ int stm32l4_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();
@ -1500,9 +1474,7 @@ int stm32l4_rtc_cancelalarm(enum alm_id_e alarmid)
g_alarmcb[alarmid].ac_cb = NULL; g_alarmcb[alarmid].ac_cb = NULL;
g_alarmcb[alarmid].ac_arg = NULL; g_alarmcb[alarmid].ac_arg = NULL;
/* Need to follow RTC register wrote protection. /* Disable the write protection for RTC registers */
* Disable the write protection for RTC registers
*/
rtc_wprunlock(); rtc_wprunlock();