You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/07/09 13:41:30 UTC

[nuttx] 10/14: nrf9160-dk: add timer support

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 98784e83f78968d26e2b6e6b13a9157aa060b986
Author: raiden00pl <ra...@railab.me>
AuthorDate: Sat Jul 8 12:22:15 2023 +0200

    nrf9160-dk: add timer support
---
 boards/arm/nrf91/nrf9160-dk/src/nrf91_bringup.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/boards/arm/nrf91/nrf9160-dk/src/nrf91_bringup.c b/boards/arm/nrf91/nrf9160-dk/src/nrf91_bringup.c
index 6af65629d7..fba6aad4ab 100644
--- a/boards/arm/nrf91/nrf9160-dk/src/nrf91_bringup.c
+++ b/boards/arm/nrf91/nrf9160-dk/src/nrf91_bringup.c
@@ -50,12 +50,18 @@
 #  include "nrf91_progmem.h"
 #endif
 
+#ifdef CONFIG_TIMER
+#  include "nrf91_timer.h"
+#endif
+
 #include "nrf9160-dk.h"
 
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
+#define NRF91_TIMER (0)
+
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
@@ -113,6 +119,18 @@ int nrf91_bringup(void)
     }
 #endif
 
+#if defined(CONFIG_TIMER) && defined(CONFIG_NRF91_TIMER)
+  /* Configure TIMER driver */
+
+  ret = nrf91_timer_driver_setup("/dev/timer0", NRF91_TIMER);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR,
+             "ERROR: Failed to initialize timer driver: %d\n",
+             ret);
+    }
+#endif
+
 #ifdef CONFIG_NRF91_MODEM
   /* Initialize modem */