From 18cf6aef166c353e7a54e312e573c9f1aea117c3 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 16 Nov 2023 14:11:48 +0100 Subject: [PATCH] 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 ****************************************************************************/