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 18cf6aef166c353e7a54e312e573c9f1aea117c3
Author: raiden00pl <[email protected]>
AuthorDate: Thu Nov 16 14:11:48 2023 +0100

    nrf91/nrf91_modem.c: add support for board-specific modem configuration
    
    this can be used to configure an antenna that is specific to a given board
---
 arch/arm/src/nrf91/nrf91_modem.c | 20 ++++++++++++++++++++
 arch/arm/src/nrf91/nrf91_modem.h |  9 +++++++++
 2 files changed, 29 insertions(+)

diff --git a/arch/arm/src/nrf91/nrf91_modem.c b/arch/arm/src/nrf91/nrf91_modem.c
index 90ebe45d81..c18e2adac9 100644
--- a/arch/arm/src/nrf91/nrf91_modem.c
+++ b/arch/arm/src/nrf91/nrf91_modem.c
@@ -120,7 +120,27 @@ int nrf91_modem_initialize(void)
   if (ret < 0)
     {
       nerr("nrf_modem_init failed %d\n", ret);
+      goto errout;
     }
 
+  /* Initial modem configuration */
+
+  ret = nrf91_modem_config();
+  if (ret < 0)
+    {
+      nerr("nrf91_modem_config failed %d\n", ret);
+      goto errout;
+    }
+
+  /* Board-specific modem configuration */
+
+  ret = nrf91_modem_board_init();
+  if (ret < 0)
+    {
+      nerr("nrf91_modem_board_init failed %d\n", ret);
+      goto errout;
+    }
+
+errout:
   return ret;
 }
diff --git a/arch/arm/src/nrf91/nrf91_modem.h b/arch/arm/src/nrf91/nrf91_modem.h
index 5fe048b459..16e0b2d43c 100644
--- a/arch/arm/src/nrf91/nrf91_modem.h
+++ b/arch/arm/src/nrf91/nrf91_modem.h
@@ -76,6 +76,15 @@
  * Public Functions Prototypes
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: nrf91_modem_board_init
+ *
+ * This function must be provided by board-spcific logic.
+ *
+ ****************************************************************************/
+
+int nrf91_modem_board_init(void);
+
 /****************************************************************************
  * Name: nrf91_modem_initialize
  ****************************************************************************/

Reply via email to