diff --git a/boards/arm/stm32f7/common/src/CMakeLists.txt b/boards/arm/stm32f7/common/src/CMakeLists.txt index 28a0318dd27..4c991280570 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 eb7a96916fd..2f1a7b45444 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 c08b820c05e..2a223d80049 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 #include -#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 6d78330177c..bd9d8da2148 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 8c1d6f881a3..684c5f47861 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 193920163f3..c454797bc3d 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 b5db10b2a9a..a506f3c8930 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 a95e8e5c8d3..00000000000 --- 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 - -#include -#include - -#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 30e1c6b9bf1..171173a94c0 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 1eef7361c29..c3f6ba291d6 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 86316597020..00000000000 --- 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 - -#include -#include - -#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 */