This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit dadace363835fecc0dbe16f02f38e7305fedf799 Author: raiden00pl <[email protected]> AuthorDate: Sun Oct 20 16:54:52 2024 +0200 boards/arm/stm32f7: move reset logic to common move stm32f7 reset logic to common --- boards/arm/stm32f7/common/src/CMakeLists.txt | 4 ++ boards/arm/stm32f7/common/src/Make.defs | 4 ++ .../{nucleo-f722ze => common}/src/stm32_reset.c | 6 +-- .../arm/stm32f7/nucleo-f722ze/src/CMakeLists.txt | 4 -- boards/arm/stm32f7/nucleo-f722ze/src/Make.defs | 4 -- .../arm/stm32f7/nucleo-f746zg/src/CMakeLists.txt | 4 -- boards/arm/stm32f7/nucleo-f746zg/src/Make.defs | 4 -- boards/arm/stm32f7/nucleo-f746zg/src/stm32_reset.c | 62 ---------------------- .../arm/stm32f7/nucleo-f767zi/src/CMakeLists.txt | 4 -- boards/arm/stm32f7/nucleo-f767zi/src/Make.defs | 4 -- boards/arm/stm32f7/nucleo-f767zi/src/stm32_reset.c | 62 ---------------------- 11 files changed, 9 insertions(+), 153 deletions(-) diff --git a/boards/arm/stm32f7/common/src/CMakeLists.txt b/boards/arm/stm32f7/common/src/CMakeLists.txt index 28a0318dd2..4c99128057 100644 --- a/boards/arm/stm32f7/common/src/CMakeLists.txt +++ b/boards/arm/stm32f7/common/src/CMakeLists.txt @@ -45,4 +45,8 @@ if(CONFIG_STM32F7_ROMFS) list(APPEND SRCS stm32_romfs_initialize.c) endif() +if(CONFIG_BOARDCTL_RESET) + list(APPEND SRCS stm32_reset.c) +endif() + target_sources(board PRIVATE ${SRCS}) diff --git a/boards/arm/stm32f7/common/src/Make.defs b/boards/arm/stm32f7/common/src/Make.defs index eb7a96916f..2f1a7b4544 100644 --- a/boards/arm/stm32f7/common/src/Make.defs +++ b/boards/arm/stm32f7/common/src/Make.defs @@ -45,6 +45,10 @@ ifeq ($(CONFIG_STM32F7_ROMFS),y) CSRCS += stm32_romfs_initialize.c endif +ifeq ($(CONFIG_BOARDCTL_RESET),y) +CSRCS += stm32_reset.c +endif + DEPPATH += --dep-path src VPATH += :src CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_reset.c b/boards/arm/stm32f7/common/src/stm32_reset.c similarity index 94% rename from boards/arm/stm32f7/nucleo-f722ze/src/stm32_reset.c rename to boards/arm/stm32f7/common/src/stm32_reset.c index c08b820c05..2a223d8004 100644 --- a/boards/arm/stm32f7/nucleo-f722ze/src/stm32_reset.c +++ b/boards/arm/stm32f7/common/src/stm32_reset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/arm/stm32f7/nucleo-f722ze/src/stm32_reset.c + * boards/arm/stm32f7/common/src/stm32_reset.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -27,8 +27,6 @@ #include <nuttx/arch.h> #include <nuttx/board.h> -#ifdef CONFIG_BOARDCTL_RESET - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -58,5 +56,3 @@ int board_reset(int status) up_systemreset(); return 0; } - -#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/CMakeLists.txt b/boards/arm/stm32f7/nucleo-f722ze/src/CMakeLists.txt index 6d78330177..bd9d8da214 100644 --- a/boards/arm/stm32f7/nucleo-f722ze/src/CMakeLists.txt +++ b/boards/arm/stm32f7/nucleo-f722ze/src/CMakeLists.txt @@ -62,10 +62,6 @@ if(CONFIG_STM32F7_BBSRAM) list(APPEND SRCS stm32_bbsram.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_SENSORS_QENCODER) list(APPEND SRCS stm32_qencoder.c) endif() diff --git a/boards/arm/stm32f7/nucleo-f722ze/src/Make.defs b/boards/arm/stm32f7/nucleo-f722ze/src/Make.defs index 8c1d6f881a..684c5f4786 100644 --- a/boards/arm/stm32f7/nucleo-f722ze/src/Make.defs +++ b/boards/arm/stm32f7/nucleo-f722ze/src/Make.defs @@ -64,10 +64,6 @@ ifeq ($(CONFIG_STM32F7_BBSRAM),y) CSRCS += stm32_bbsram.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_SENSORS_QENCODER),y) CSRCS += stm32_qencoder.c endif diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/CMakeLists.txt b/boards/arm/stm32f7/nucleo-f746zg/src/CMakeLists.txt index 193920163f..c454797bc3 100644 --- a/boards/arm/stm32f7/nucleo-f746zg/src/CMakeLists.txt +++ b/boards/arm/stm32f7/nucleo-f746zg/src/CMakeLists.txt @@ -62,10 +62,6 @@ if(CONFIG_STM32F7_BBSRAM) list(APPEND SRCS stm32_bbsram.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_SENSORS_QENCODER) list(APPEND SRCS stm32_qencoder.c) endif() diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/Make.defs b/boards/arm/stm32f7/nucleo-f746zg/src/Make.defs index b5db10b2a9..a506f3c893 100644 --- a/boards/arm/stm32f7/nucleo-f746zg/src/Make.defs +++ b/boards/arm/stm32f7/nucleo-f746zg/src/Make.defs @@ -64,10 +64,6 @@ ifeq ($(CONFIG_STM32F7_BBSRAM),y) CSRCS += stm32_bbsram.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_SENSORS_QENCODER),y) CSRCS += stm32_qencoder.c endif diff --git a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_reset.c b/boards/arm/stm32f7/nucleo-f746zg/src/stm32_reset.c deleted file mode 100644 index a95e8e5c8d..0000000000 --- a/boards/arm/stm32f7/nucleo-f746zg/src/stm32_reset.c +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f7/nucleo-f746zg/src/stm32_reset.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <nuttx/arch.h> -#include <nuttx/board.h> - -#ifdef CONFIG_BOARDCTL_RESET - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ - up_systemreset(); - return 0; -} - -#endif /* CONFIG_BOARDCTL_RESET */ diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/CMakeLists.txt b/boards/arm/stm32f7/nucleo-f767zi/src/CMakeLists.txt index 30e1c6b9bf..171173a94c 100644 --- a/boards/arm/stm32f7/nucleo-f767zi/src/CMakeLists.txt +++ b/boards/arm/stm32f7/nucleo-f767zi/src/CMakeLists.txt @@ -62,10 +62,6 @@ if(CONFIG_STM32F7_BBSRAM) list(APPEND SRCS stm32_bbsram.c) endif() -if(CONFIG_BOARDCTL_RESET) - list(APPEND SRCS stm32_reset.c) -endif() - if(CONFIG_SENSORS_QENCODER) list(APPEND SRCS stm32_qencoder.c) endif() diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/Make.defs b/boards/arm/stm32f7/nucleo-f767zi/src/Make.defs index 1eef7361c2..c3f6ba291d 100644 --- a/boards/arm/stm32f7/nucleo-f767zi/src/Make.defs +++ b/boards/arm/stm32f7/nucleo-f767zi/src/Make.defs @@ -64,10 +64,6 @@ ifeq ($(CONFIG_STM32F7_BBSRAM),y) CSRCS += stm32_bbsram.c endif -ifeq ($(CONFIG_BOARDCTL_RESET),y) -CSRCS += stm32_reset.c -endif - ifeq ($(CONFIG_SENSORS_QENCODER),y) CSRCS += stm32_qencoder.c endif diff --git a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_reset.c b/boards/arm/stm32f7/nucleo-f767zi/src/stm32_reset.c deleted file mode 100644 index 8631659702..0000000000 --- a/boards/arm/stm32f7/nucleo-f767zi/src/stm32_reset.c +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32f7/nucleo-f767zi/src/stm32_reset.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <nuttx/arch.h> -#include <nuttx/board.h> - -#ifdef CONFIG_BOARDCTL_RESET - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_reset - * - * Description: - * Reset board. Support for this function is required by board-level - * logic if CONFIG_BOARDCTL_RESET is selected. - * - * Input Parameters: - * status - Status information provided with the reset event. This - * meaning of this status information is board-specific. If not - * used by a board, the value zero may be provided in calls to - * board_reset(). - * - * Returned Value: - * If this function returns, then it was not possible to power-off the - * board due to some constraints. The return value int this case is a - * board-specific reason for the failure to shutdown. - * - ****************************************************************************/ - -int board_reset(int status) -{ - up_systemreset(); - return 0; -} - -#endif /* CONFIG_BOARDCTL_RESET */
