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


The following commit(s) were added to refs/heads/master by this push:
     new ca95d592d3 boards/stm32f4disco: add timer driver support
ca95d592d3 is described below

commit ca95d592d34a60f9c71cc4278708cf4e4fb19669
Author: raiden00pl <[email protected]>
AuthorDate: Tue Feb 7 17:00:04 2023 +0100

    boards/stm32f4disco: add timer driver support
---
 boards/arm/stm32/stm32f4discovery/Kconfig             |  5 +++++
 boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/boards/arm/stm32/stm32f4discovery/Kconfig 
b/boards/arm/stm32/stm32f4discovery/Kconfig
index f6418a2ab9..7b86a5cafe 100644
--- a/boards/arm/stm32/stm32f4discovery/Kconfig
+++ b/boards/arm/stm32/stm32f4discovery/Kconfig
@@ -49,6 +49,11 @@ config STM32F4DISCO_QETIMER
        default 2
        depends on SENSORS_QENCODER
 
+config STM32F4DISCO_TIMER
+       int "Timer to use with timer driver"
+       default 4
+       depends on TIMER
+
 config STM32F4DISCO_LIS3DSH
        bool "Enable LIS3DSH driver for the IMU on STM32F4Discovery (rev. 
MB997C)"
        default n
diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c 
b/boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c
index d1d77384e3..8aef29a9f2 100644
--- a/boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c
+++ b/boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c
@@ -351,6 +351,16 @@ int stm32_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_TIMER
+  /* Initialize TIMER and register the TIMER device. */
+
+  ret = stm32_timer_driver_setup("/dev/timer0", CONFIG_STM32F4DISCO_TIMER);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: stm32_timer_driver_setup() failed: %d\n", ret);
+    }
+#endif
+
 #ifdef CONFIG_CAPTURE
   /* Initialize Capture and register the Capture driver. */
 

Reply via email to