From 2319ea53a9af9b5292a6e489a64ddfdb62de4157 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 22 Jul 2017 09:53:29 -0600 Subject: [PATCH] STM32L4: Eliminate a warning about implicit definition of function. While we are at it, let's improve the naming a little too. --- arch/arm/src/stm32l4/stm32l4_spi.c | 2 +- arch/arm/src/stm32l4/stm32l4_spi.h | 2 +- arch/arm/src/stm32l4/stm32l4_start.c | 2 +- arch/arm/src/stm32l4/stm32l4_start.h | 59 ++++++++++++++++++++++ configs/b-l475e-iot01a/src/stm32_boot.c | 11 ++-- configs/nucleo-l432kc/include/board.h | 4 +- configs/nucleo-l432kc/src/stm32_boot.c | 4 +- configs/nucleo-l432kc/src/stm32_spi.c | 2 +- configs/nucleo-l452re/include/board.h | 4 +- configs/nucleo-l452re/src/stm32_boot.c | 4 +- configs/nucleo-l452re/src/stm32_spi.c | 2 +- configs/nucleo-l476rg/include/board.h | 4 +- configs/nucleo-l476rg/src/stm32_boot.c | 4 +- configs/nucleo-l476rg/src/stm32_spi.c | 2 +- configs/nucleo-l496zg/include/board.h | 4 +- configs/nucleo-l496zg/src/stm32_boot.c | 4 +- configs/stm32l476-mdk/include/board.h | 4 +- configs/stm32l476-mdk/src/stm32_boot.c | 4 +- configs/stm32l476vg-disco/include/board.h | 4 +- configs/stm32l476vg-disco/src/stm32_boot.c | 4 +- 20 files changed, 95 insertions(+), 35 deletions(-) create mode 100644 arch/arm/src/stm32l4/stm32l4_start.h diff --git a/arch/arm/src/stm32l4/stm32l4_spi.c b/arch/arm/src/stm32l4/stm32l4_spi.c index 9d9db706e0..67efad4aa8 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.c +++ b/arch/arm/src/stm32l4/stm32l4_spi.c @@ -41,7 +41,7 @@ * are provided by common STM32 logic. To use this common SPI logic on your * board: * - * 1. Provide logic in stm32l4_boardinitialize() to configure SPI chip select + * 1. Provide logic in stm32l4_board_initialize() to configure SPI chip select * pins. * 2. Provide stm32l4_spi1/2/3select() and stm32l4_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and diff --git a/arch/arm/src/stm32l4/stm32l4_spi.h b/arch/arm/src/stm32l4/stm32l4_spi.h index 223cfb2b3d..7f5390f347 100644 --- a/arch/arm/src/stm32l4/stm32l4_spi.h +++ b/arch/arm/src/stm32l4/stm32l4_spi.h @@ -97,7 +97,7 @@ FAR struct spi_dev_s *stm32l4_spibus_initialize(int bus); * (including stm32l4_spibus_initialize()) are provided by common STM32 logic. To use this * common SPI logic on your board: * - * 1. Provide logic in stm32l4_boardinitialize() to configure SPI chip select + * 1. Provide logic in stm32l4_board_initialize() to configure SPI chip select * pins. * 2. Provide stm32l4_spi1/2/...select() and stm32l4_spi1/2/...status() functions in your * board-specific logic. These functions will perform chip selection and diff --git a/arch/arm/src/stm32l4/stm32l4_start.c b/arch/arm/src/stm32l4/stm32l4_start.c index b2053f25ed..9d068fb46a 100644 --- a/arch/arm/src/stm32l4/stm32l4_start.c +++ b/arch/arm/src/stm32l4/stm32l4_start.c @@ -358,7 +358,7 @@ void __start(void) /* Initialize onboard resources */ - stm32l4_boardinitialize(); + stm32l4_board_initialize(); showprogress('F'); /* Then start NuttX */ diff --git a/arch/arm/src/stm32l4/stm32l4_start.h b/arch/arm/src/stm32l4/stm32l4_start.h new file mode 100644 index 0000000000..618b5cdcb7 --- /dev/null +++ b/arch/arm/src/stm32l4/stm32l4_start.h @@ -0,0 +1,59 @@ +/************************************************************************************ + * arch/arm/src/stm32l4/stm32l4_start.h + * + * Copyrigth (C) 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +#ifndef __ARCH_ARM_SRC_STM32L4_STM32L4_START_H +#define __ARCH_ARM_SRC_STM32L4_STM32L4_START_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +/************************************************************************************ + * Public Function Prototypes + ************************************************************************************/ + +/************************************************************************************ + * Name: stm32l4_board_initialize + * + * Description: + * All STM32L4 architectures must provide the following entry point. This entry + * point is called early in the initialization -- after all memory has been + * configured and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void stm32l4_board_initialize(void); + +#endif /* __ARCH_ARM_SRC_STM32L4_STM32L4_START_H */ diff --git a/configs/b-l475e-iot01a/src/stm32_boot.c b/configs/b-l475e-iot01a/src/stm32_boot.c index a4a1b3cf58..118a83fc33 100644 --- a/configs/b-l475e-iot01a/src/stm32_boot.c +++ b/configs/b-l475e-iot01a/src/stm32_boot.c @@ -43,6 +43,7 @@ #include #include "up_arch.h" +#include "stm32l4_start.h" #include "b-l475e-iot01a.h" /************************************************************************************ @@ -50,16 +51,16 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32_boardinitialize + * Name: stm32l4_board_initialize * * Description: - * All STM32 architectures must provide the following entry point. This entry point - * is called early in the initialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All STM32L4 architectures must provide the following entry point. This entry + * point is called early in the initialization -- after all memory has been + * configured and mapped but before any devices have been initialized. * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/nucleo-l432kc/include/board.h b/configs/nucleo-l432kc/include/board.h index 2d0c152e6f..de5fdb345c 100644 --- a/configs/nucleo-l432kc/include/board.h +++ b/configs/nucleo-l432kc/include/board.h @@ -243,7 +243,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -252,7 +252,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/nucleo-l432kc/src/stm32_boot.c b/configs/nucleo-l432kc/src/stm32_boot.c index e460316949..f4bc7c3945 100644 --- a/configs/nucleo-l432kc/src/stm32_boot.c +++ b/configs/nucleo-l432kc/src/stm32_boot.c @@ -64,7 +64,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -73,7 +73,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/nucleo-l432kc/src/stm32_spi.c b/configs/nucleo-l432kc/src/stm32_spi.c index 731030f7ed..cb1732dbe2 100644 --- a/configs/nucleo-l432kc/src/stm32_spi.c +++ b/configs/nucleo-l432kc/src/stm32_spi.c @@ -114,7 +114,7 @@ void stm32l4_spiinitialize(void) * are provided by common STM32 logic. To use this common SPI logic on your * board: * - * 1. Provide logic in stm32l4_boardinitialize() to configure SPI chip select + * 1. Provide logic in stm32l4_board_initialize() to configure SPI chip select * pins. * 2. Provide stm32l4_spi1/2select() and stm32l4_spi1/2status() functions in your * board-specific logic. These functions will perform chip selection and diff --git a/configs/nucleo-l452re/include/board.h b/configs/nucleo-l452re/include/board.h index 30e452dca7..2e2a85e993 100644 --- a/configs/nucleo-l452re/include/board.h +++ b/configs/nucleo-l452re/include/board.h @@ -252,7 +252,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -261,7 +261,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/nucleo-l452re/src/stm32_boot.c b/configs/nucleo-l452re/src/stm32_boot.c index 9e7c287303..182a51df27 100644 --- a/configs/nucleo-l452re/src/stm32_boot.c +++ b/configs/nucleo-l452re/src/stm32_boot.c @@ -53,7 +53,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32 architectures must provide the following entry point. This entry point @@ -62,7 +62,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/nucleo-l452re/src/stm32_spi.c b/configs/nucleo-l452re/src/stm32_spi.c index 02f17ca607..7330f7e5dd 100644 --- a/configs/nucleo-l452re/src/stm32_spi.c +++ b/configs/nucleo-l452re/src/stm32_spi.c @@ -117,7 +117,7 @@ void weak_function stm32l4_spiinitialize(void) * are provided by common STM32 logic. To use this common SPI logic on your * board: * - * 1. Provide logic in stm32l4_boardinitialize() to configure SPI chip select + * 1. Provide logic in stm32l4_board_initialize() to configure SPI chip select * pins. * 2. Provide stm32l4_spi1/2/3select() and stm32l4_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and diff --git a/configs/nucleo-l476rg/include/board.h b/configs/nucleo-l476rg/include/board.h index 490e5af968..0cbecee0c5 100644 --- a/configs/nucleo-l476rg/include/board.h +++ b/configs/nucleo-l476rg/include/board.h @@ -249,7 +249,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -258,7 +258,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/nucleo-l476rg/src/stm32_boot.c b/configs/nucleo-l476rg/src/stm32_boot.c index 2acb52ee62..a8af653206 100644 --- a/configs/nucleo-l476rg/src/stm32_boot.c +++ b/configs/nucleo-l476rg/src/stm32_boot.c @@ -64,7 +64,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -73,7 +73,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/nucleo-l476rg/src/stm32_spi.c b/configs/nucleo-l476rg/src/stm32_spi.c index 6e45b6f76c..5047ee3d0a 100644 --- a/configs/nucleo-l476rg/src/stm32_spi.c +++ b/configs/nucleo-l476rg/src/stm32_spi.c @@ -126,7 +126,7 @@ void weak_function stm32l4_spiinitialize(void) * are provided by common STM32 logic. To use this common SPI logic on your * board: * - * 1. Provide logic in stm32l4_boardinitialize() to configure SPI chip select + * 1. Provide logic in stm32l4_board_initialize() to configure SPI chip select * pins. * 2. Provide stm32l4_spi1/2/3select() and stm32l4_spi1/2/3status() functions in your * board-specific logic. These functions will perform chip selection and diff --git a/configs/nucleo-l496zg/include/board.h b/configs/nucleo-l496zg/include/board.h index 7f4bc3b5af..87f69f92d9 100644 --- a/configs/nucleo-l496zg/include/board.h +++ b/configs/nucleo-l496zg/include/board.h @@ -438,7 +438,7 @@ extern "C" ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32 architectures must provide the following entry point. This entry point @@ -447,7 +447,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/nucleo-l496zg/src/stm32_boot.c b/configs/nucleo-l496zg/src/stm32_boot.c index 5cf32fbb22..ec2bff2d24 100644 --- a/configs/nucleo-l496zg/src/stm32_boot.c +++ b/configs/nucleo-l496zg/src/stm32_boot.c @@ -53,7 +53,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32 architectures must provide the following entry point. This entry point @@ -62,7 +62,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/stm32l476-mdk/include/board.h b/configs/stm32l476-mdk/include/board.h index 39f0e861ef..771b43e798 100644 --- a/configs/stm32l476-mdk/include/board.h +++ b/configs/stm32l476-mdk/include/board.h @@ -135,7 +135,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry @@ -144,7 +144,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/stm32l476-mdk/src/stm32_boot.c b/configs/stm32l476-mdk/src/stm32_boot.c index 3d907d49bb..55b3f6af75 100644 --- a/configs/stm32l476-mdk/src/stm32_boot.c +++ b/configs/stm32l476-mdk/src/stm32_boot.c @@ -56,7 +56,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -65,7 +65,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { /* Configure on-board LEDs if LED support has been selected. */ diff --git a/configs/stm32l476vg-disco/include/board.h b/configs/stm32l476vg-disco/include/board.h index ee28c35a06..5713b402e8 100644 --- a/configs/stm32l476vg-disco/include/board.h +++ b/configs/stm32l476vg-disco/include/board.h @@ -293,7 +293,7 @@ extern "C" * Public Function Prototypes ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -302,7 +302,7 @@ extern "C" * ************************************************************************************/ -void stm32l4_boardinitialize(void); +void stm32l4_board_initialize(void); #undef EXTERN #if defined(__cplusplus) diff --git a/configs/stm32l476vg-disco/src/stm32_boot.c b/configs/stm32l476vg-disco/src/stm32_boot.c index e3711ec9ba..56723d783d 100644 --- a/configs/stm32l476vg-disco/src/stm32_boot.c +++ b/configs/stm32l476vg-disco/src/stm32_boot.c @@ -56,7 +56,7 @@ ************************************************************************************/ /************************************************************************************ - * Name: stm32l4_boardinitialize + * Name: stm32l4_board_initialize * * Description: * All STM32L4 architectures must provide the following entry point. This entry point @@ -65,7 +65,7 @@ * ************************************************************************************/ -void stm32l4_boardinitialize(void) +void stm32l4_board_initialize(void) { /* Configure on-board LEDs if LED support has been selected. */