This is an automated email from the ASF dual-hosted git repository. aguettouche pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push: new e4c7254 arch/stm32: Fix nxstyle errors e4c7254 is described below commit e4c725481c4a9fa1170ff90c6ddc083fc9612f7f Author: Nathan Hartman <59230071+hartmannat...@users.noreply.github.com> AuthorDate: Thu Dec 3 10:04:05 2020 -0500 arch/stm32: Fix nxstyle errors arch/arm/src/stm32/stm32_alarm.h, arch/arm/src/stm32/stm32_can.h, arch/arm/src/stm32/stm32_capture.h: * Fix nxstyle errors. --- arch/arm/src/stm32/stm32_alarm.h | 26 +++++------ arch/arm/src/stm32/stm32_can.h | 33 +++++++------ arch/arm/src/stm32/stm32_capture.h | 94 +++++++++++++++++++------------------- 3 files changed, 79 insertions(+), 74 deletions(-) diff --git a/arch/arm/src/stm32/stm32_alarm.h b/arch/arm/src/stm32/stm32_alarm.h index 67bf648..5407e3f 100644 --- a/arch/arm/src/stm32/stm32_alarm.h +++ b/arch/arm/src/stm32/stm32_alarm.h @@ -1,4 +1,4 @@ -/**************************************************************************** +/***************************************************************************** * arch/arm/src/stm32/stm32_alarm.h * * Copyright (C) 2011 Uros Platise. All rights reserved. @@ -33,14 +33,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ****************************************************************************/ + *****************************************************************************/ #ifndef __ARCH_ARM_SRC_STM32_STM32_ALARM_H #define __ARCH_ARM_SRC_STM32_STM32_ALARM_H -/**************************************************************************** +/***************************************************************************** * Included Files - ****************************************************************************/ + *****************************************************************************/ #include <nuttx/config.h> @@ -48,9 +48,9 @@ #ifdef CONFIG_RTC_ALARM -/**************************************************************************** +/***************************************************************************** * Public Types - ****************************************************************************/ + *****************************************************************************/ #ifndef __ASSEMBLY__ @@ -58,9 +58,9 @@ typedef CODE void (*alarmcb_t)(void); -/**************************************************************************** - * Public Functions - ****************************************************************************/ +/***************************************************************************** + * Public Function Prototypes + *****************************************************************************/ #undef EXTERN #if defined(__cplusplus) @@ -71,7 +71,7 @@ extern "C" #define EXTERN extern #endif -/**************************************************************************** +/***************************************************************************** * Name: stm32_rtc_setalarm * * Description: @@ -84,12 +84,12 @@ extern "C" * Returned Value: * Zero (OK) on success; a negated errno on failure * - ****************************************************************************/ + *****************************************************************************/ struct timespec; int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback); -/**************************************************************************** +/***************************************************************************** * Name: stm32_rtc_cancelalarm * * Description: @@ -101,7 +101,7 @@ int stm32_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback); * Returned Value: * Zero (OK) on success; a negated errno on failure * - ****************************************************************************/ + *****************************************************************************/ int stm32_rtc_cancelalarm(void); diff --git a/arch/arm/src/stm32/stm32_can.h b/arch/arm/src/stm32/stm32_can.h index 336d945..f3ecfd2 100644 --- a/arch/arm/src/stm32/stm32_can.h +++ b/arch/arm/src/stm32/stm32_can.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/stm32/stm32_can.h * * Copyright (C) 2009, 2011, 2015 Gregory Nutt. All rights reserved. @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_STM32_STM32_CAN_H #define __ARCH_ARM_SRC_STM32_STM32_CAN_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include <nuttx/config.h> @@ -47,10 +47,12 @@ #include <nuttx/can/can.h> -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + /* Up to 2 CAN interfaces are supported */ #if STM32_NCAN < 2 @@ -61,7 +63,8 @@ # undef CONFIG_STM32_CAN1 #endif -#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) +#if defined(CONFIG_CAN) && \ + (defined(CONFIG_STM32_CAN1) || defined(CONFIG_STM32_CAN2)) /* CAN BAUD */ @@ -96,15 +99,15 @@ # error "CONFIG_STM32_CAN_TSEG2 is out of range" #endif -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) @@ -115,9 +118,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: stm32_caninitialize diff --git a/arch/arm/src/stm32/stm32_capture.h b/arch/arm/src/stm32/stm32_capture.h index 225dbf7..177d2b5 100644 --- a/arch/arm/src/stm32/stm32_capture.h +++ b/arch/arm/src/stm32/stm32_capture.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/stm32/stm32_capture.h * * Copyright (C) 2015 Bouteville Pierre-Noel. All rights reserved. @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_ARM_SRC_STM32_STM32_CAPTURE_H #define __ARCH_ARM_SRC_STM32_STM32_CAPTURE_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include <nuttx/config.h> @@ -46,10 +46,11 @@ #include <arch/board/board.h> #include "hardware/stm32_tim.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Helpers **************************************************************************/ + ****************************************************************************/ + +/* Helpers ******************************************************************/ #define STM32_CAP_SETCLOCK(d,clk_src,psc,max) ((d)->ops->setclock(d,clk_src,psc,max)) #define STM32_CAP_SETCHANNEL(d,ch,cfg) ((d)->ops->setchannel(d,ch,cfg)) @@ -59,9 +60,9 @@ #define STM32_CAP_ACKFLAGS(d,f) ((d)->ops->ackflags(d,f)) #define STM32_CAP_GETFLAGS(d) ((d)->ops->getflags(d)) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -90,61 +91,60 @@ typedef enum STM32_CAP_MAPPED_MASK = (GTIM_CCMR1_CC1S_MASK), STM32_CAP_MAPPED_TI1 = (GTIM_CCMR_CCS_CCIN1), STM32_CAP_MAPPED_TI2 = (GTIM_CCMR_CCS_CCIN2), -/*TODO STM32_CAP_MAPPED_TRC = (GTIM_CCMR_CCS_CCINTRC), */ + +/* TODO STM32_CAP_MAPPED_TRC = (GTIM_CCMR_CCS_CCINTRC), */ /* Event prescaler */ STM32_CAP_INPSC_MASK = (GTIM_CCMR1_IC1PSC_MASK), - STM32_CAP_INPSC_NO = (0<<GTIM_CCMR1_IC1PSC_SHIFT), - STM32_CAP_INPSC_2EVENTS = (1<<GTIM_CCMR1_IC1PSC_SHIFT), - STM32_CAP_INPSC_4EVENTS = (2<<GTIM_CCMR1_IC1PSC_SHIFT), - STM32_CAP_INPSC_8EVENTS = (3<<GTIM_CCMR1_IC1PSC_SHIFT), + STM32_CAP_INPSC_NO = (0 << GTIM_CCMR1_IC1PSC_SHIFT), + STM32_CAP_INPSC_2EVENTS = (1 << GTIM_CCMR1_IC1PSC_SHIFT), + STM32_CAP_INPSC_4EVENTS = (2 << GTIM_CCMR1_IC1PSC_SHIFT), + STM32_CAP_INPSC_8EVENTS = (3 << GTIM_CCMR1_IC1PSC_SHIFT), /* Event prescaler */ STM32_CAP_FILTER_MASK = (GTIM_CCMR1_IC1F_MASK), - STM32_CAP_FILTER_NO = (0<<GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_NO = (0 << GTIM_CCMR1_IC1F_SHIFT), /* Internal clock with N time to confirm event */ - STM32_CAP_FILTER_INT_N2 = (1<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_INT_N4 = (2<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_INT_N8 = (3<<GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_INT_N2 = (1 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_INT_N4 = (2 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_INT_N8 = (3 << GTIM_CCMR1_IC1F_SHIFT), /* DTS clock div by D with N time to confirm event */ - STM32_CAP_FILTER_DTS_D2_N6 = (4<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D2_N8 = (5<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D4_N6 = (6<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D4_N8 = (7<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D8_N6 = (8<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D8_N8 = (9<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D16_N5 = (10<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D16_N6 = (11<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D16_N8 = (12<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D32_N5 = (13<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D32_N6 = (14<<GTIM_CCMR1_IC1F_SHIFT), - STM32_CAP_FILTER_DTS_D32_N8 = (15<<GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D2_N6 = (4 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D2_N8 = (5 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D4_N6 = (6 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D4_N8 = (7 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D8_N6 = (8 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D8_N8 = (9 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D16_N5 = (10 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D16_N6 = (11 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D16_N8 = (12 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D32_N5 = (13 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D32_N6 = (14 << GTIM_CCMR1_IC1F_SHIFT), + STM32_CAP_FILTER_DTS_D32_N8 = (15 << GTIM_CCMR1_IC1F_SHIFT), /* EDGE */ - STM32_CAP_EDGE_MASK = (3<<8), - STM32_CAP_EDGE_DISABLED = (0<<8), - STM32_CAP_EDGE_RISING = (1<<8), - STM32_CAP_EDGE_FALLING = (2<<8), - STM32_CAP_EDGE_BOTH = (3<<8), - + STM32_CAP_EDGE_MASK = (3 << 8), + STM32_CAP_EDGE_DISABLED = (0 << 8), + STM32_CAP_EDGE_RISING = (1 << 8), + STM32_CAP_EDGE_FALLING = (2 << 8), + STM32_CAP_EDGE_BOTH = (3 << 8), } stm32_cap_ch_cfg_t; /* Capture clock sources */ typedef enum { - STM32_CAP_CLK_INT= 0, + STM32_CAP_CLK_INT = 0, STM32_CAP_CLK_EXT, /* TODO: Add other clock */ - } stm32_cap_clk_t; /* Capture flags */ @@ -164,7 +164,6 @@ typedef enum STM32_CAP_FLAG_OF_CH_2 = (GTIM_SR_CC2OF), STM32_CAP_FLAG_OF_CH_3 = (GTIM_SR_CC3OF), STM32_CAP_FLAG_OF_CH_4 = (GTIM_SR_CC4OF) - } stm32_cap_flags_t; #define STM32_CAP_FLAG_IRQ_CH(ch) (GTIM_SR_CC1IF<<((ch)-1)) @@ -175,18 +174,21 @@ typedef enum struct stm32_cap_ops_s { - int (*setclock)( FAR struct stm32_cap_dev_s *dev, stm32_cap_clk_t clk, uint32_t prescaler, uint32_t max); - int (*setchannel)(FAR struct stm32_cap_dev_s *dev, uint8_t channel, stm32_cap_ch_cfg_t cfg); + int (*setclock)(FAR struct stm32_cap_dev_s *dev, stm32_cap_clk_t clk, + uint32_t prescaler, uint32_t max); + int (*setchannel)(FAR struct stm32_cap_dev_s *dev, uint8_t channel, + stm32_cap_ch_cfg_t cfg); uint32_t (*getcapture)(FAR struct stm32_cap_dev_s *dev, uint8_t channel); int (*setisr)(FAR struct stm32_cap_dev_s *dev, xcpt_t handler, void *arg); - void (*enableint)( FAR struct stm32_cap_dev_s *dev, stm32_cap_flags_t src, bool on ); - void (*ackflags)( FAR struct stm32_cap_dev_s *dev, int flags); + void (*enableint)(FAR struct stm32_cap_dev_s *dev, stm32_cap_flags_t src, + bool on); + void (*ackflags)(FAR struct stm32_cap_dev_s *dev, int flags); stm32_cap_flags_t (*getflags)(FAR struct stm32_cap_dev_s *dev); }; -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /* Power-up timer and get its structure */