This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 527af3103245d93d772bfdecf15d2c9377fac946 Author: raiden00pl <[email protected]> AuthorDate: Tue Nov 3 11:00:24 2026 +0100 boards/nucleo-l476rg: Register the timers with the board common code. TIM2 was registered as /dev/timer0 by the board. The board common BOARD_STM32_COMMON_TIM2_TIMER option registers it as /dev/timer2. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: raiden00pl <[email protected]> --- .../arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt | 4 -- boards/arm/stm32l4/nucleo-l476rg/src/Make.defs | 4 -- .../arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h | 12 ---- .../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 12 ---- boards/arm/stm32l4/nucleo-l476rg/src/stm32_timer.c | 67 ---------------------- 5 files changed, 99 deletions(-) diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt b/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt index a2103c09c77..17167f51260 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt +++ b/boards/arm/stm32l4/nucleo-l476rg/src/CMakeLists.txt @@ -83,10 +83,6 @@ if(CONFIG_PWM) list(APPEND SRCS stm32_pwm.c) endif() -if(CONFIG_TIMER) - list(APPEND SRCS stm32_timer.c) -endif() - if(CONFIG_BOARDCTL_IOCTL) list(APPEND SRCS stm32_ioctl.c) endif() diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs b/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs index bc23da333b1..3ef6f1719d8 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs +++ b/boards/arm/stm32l4/nucleo-l476rg/src/Make.defs @@ -86,10 +86,6 @@ ifeq ($(CONFIG_PWM),y) CSRCS += stm32_pwm.c endif -ifeq ($(CONFIG_TIMER),y) -CSRCS += stm32_timer.c -endif - ifeq ($(CONFIG_BOARDCTL_IOCTL),y) CSRCS += stm32_ioctl.c endif diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h index 902e07de319..3a1b1baa4d7 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h +++ b/boards/arm/stm32l4/nucleo-l476rg/src/nucleo-l476rg.h @@ -363,18 +363,6 @@ int board_ajoy_initialize(void); int stm32_mmcsd_initialize(int minor); #endif -/**************************************************************************** - * Name: board_timer_driver_initialize - * - * Description: - * Initialize and register a timer - * - ****************************************************************************/ - -#ifdef CONFIG_TIMER -int board_timer_driver_initialize(const char *devpath, int timer); -#endif - /**************************************************************************** * Name: stm32_qencoder_initialize * diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c index 4804921212b..96db84d854a 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c @@ -239,18 +239,6 @@ int stm32_bringup(void) } #endif -#ifdef CONFIG_TIMER - /* Initialize and register the timer driver */ - - ret = board_timer_driver_initialize("/dev/timer0", 2); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: Failed to register the timer driver: %d\n", - ret); - return ret; - } -#endif - #ifdef CONFIG_SENSORS_QENCODER /* Initialize and register the qencoder driver */ diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_timer.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_timer.c deleted file mode 100644 index a29fd9da67f..00000000000 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_timer.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * boards/arm/stm32l4/nucleo-l476rg/src/stm32_timer.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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/timers/timer.h> - -#include <nuttx/debug.h> - -#include "stm32_tim.h" -#include "nucleo-l476rg.h" - -#ifdef CONFIG_TIMER - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_timer_driver_initialize - * - * Description: - * Configure the timer driver. - * - * Input Parameters: - * devpath - The full path to the timer device. This should be of the - * form /dev/timer0 - * timer - The timer's number. - * - * Returned Value: - * Zero (OK) is returned on success; A negated errno value is returned - * to indicate the nature of any failure. - * - ****************************************************************************/ - -int board_timer_driver_initialize(const char *devpath, int timer) -{ - return stm32_timer_initialize(devpath, timer); -} - -#endif
