Skip to content

Commit 4509e65

Browse files
lemreyrlubos
authored andcommitted
lib: at_monitor: remove AT_MONITOR_SYS_INIT
Library shall always initialize automatically when enabled. There was no reason not to. Signed-off-by: Emanuele Di Santo <[email protected]> Signed-off-by: Divya Pillai <[email protected]>
1 parent 9f2189a commit 4509e65

File tree

10 files changed

+2
-40
lines changed

10 files changed

+2
-40
lines changed

doc/nrf/libraries/modem/at_monitor.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ The AT monitor library facilitates the integration of the Modem library in |NCS|
2929
Initialization
3030
==============
3131

32-
The application can initialize the AT monitor library in the following ways:
33-
34-
* Manually by using the :c:func:`at_monitor_init` function.
35-
* Automatically by using the ``SYS_INIT`` macro and by enabling :kconfig:`CONFIG_AT_MONITOR_SYS_INIT`.
36-
32+
The AT monitor library initializes automatically when enabled using :kconfig:`CONFIG_AT_MONITOR`.
3733
Upon initialization, the AT monitor library registers itself as the receiver of AT notifications from the Modem library (using :c:func:`nrf_modem_at_notif_handler_set`).
3834

3935
.. note::

doc/nrf/releases/release-notes-changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Modem libraries
218218
* :ref:`at_monitor_readme` library:
219219

220220
* Introduced AT_MONITOR_ISR macro to monitor AT notifications in an interrupt service routine.
221+
* Removed :c:func:`at_monitor_init` function and :kconfig:`CONFIG_AT_MONITOR_SYS_INIT` option. The library now initializes automatically when enabled.
221222

222223
* :ref:`at_cmd_parser_readme` library:
223224

include/modem/at_monitor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ struct at_monitor_isr_entry {
5757
bool paused;
5858
};
5959

60-
/**
61-
* @brief Ready to dispatch notifications to monitors.
62-
*/
63-
void at_monitor_init(void);
64-
6560
/** Wildcard. Match any notifications. */
6661
#define ANY NULL
6762
/** Monitor is paused. */

lib/at_monitor/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ menuconfig AT_MONITOR
99

1010
if AT_MONITOR
1111

12-
config AT_MONITOR_SYS_INIT
13-
bool "Initialize during SYS_INIT"
14-
depends on NRF_MODEM_LIB_SYS_INIT
15-
default y
16-
1712
config AT_MONITOR_HEAP_SIZE
1813
int "Heap size for notifications"
1914
range 64 2048

lib/at_monitor/at_monitor.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,5 @@ static int at_monitor_sys_init(const struct device *unused)
100100
return 0;
101101
}
102102

103-
#if defined(CONFIG_AT_MONITOR_SYS_INIT)
104103
/* Initialize during SYS_INIT */
105104
SYS_INIT(at_monitor_sys_init, APPLICATION, 0);
106-
#endif
107-
108-
void at_monitor_init(void)
109-
{
110-
at_monitor_sys_init(NULL);
111-
}

lib/at_shell/at_shell.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ int at_shell(const struct shell *shell, size_t argc, char **argv)
4848
char *command = argv[1];
4949

5050
if (!strcmp(command, "events_enable")) {
51-
if (!IS_ENABLED(CONFIG_AT_MONITOR_SYS_INIT)) {
52-
at_monitor_init();
53-
}
54-
5551
at_monitor_resume(at_shell_monitor);
5652
shell_print(shell, "AT command event handler enabled");
5753
} else if (!strcmp(command, "events_disable")) {

lib/bin/lwm2m_carrier/os/lwm2m_os.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,6 @@ int lwm2m_os_at_init(void)
384384
return -EIO;
385385
}
386386

387-
at_monitor_init();
388-
389387
return 0;
390388
}
391389

lib/date_time/date_time_core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ void date_time_lte_ind_handler(const struct lte_lc_evt *const evt)
141141

142142
void date_time_core_init(void)
143143
{
144-
if (IS_ENABLED(CONFIG_DATE_TIME_MODEM) && IS_ENABLED(CONFIG_DATE_TIME_AUTO_UPDATE) &&
145-
!IS_ENABLED(CONFIG_AT_MONITOR_SYS_INIT)) {
146-
at_monitor_init();
147-
}
148-
149144
if (IS_ENABLED(CONFIG_DATE_TIME_AUTO_UPDATE) && IS_ENABLED(CONFIG_LTE_LINK_CONTROL)) {
150145
lte_lc_register_handler(date_time_lte_ind_handler);
151146
}

lib/lte_link_control/lte_lc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,6 @@ static int init_and_config(void)
559559
{
560560
int err;
561561

562-
if (!IS_ENABLED(CONFIG_AT_MONITOR_SYS_INIT)) {
563-
at_monitor_init();
564-
}
565-
566562
if (is_initialized) {
567563
return -EALREADY;
568564
}

samples/nrf9160/modem_shell/src/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ void main(void)
147147
at_cmd_init();
148148
#if !defined(CONFIG_AT_NOTIF_SYS_INIT)
149149
at_notif_init();
150-
#endif
151-
#if !defined(CONFIG_AT_MONITOR_SYS_INIT)
152-
at_monitor_init();
153150
#endif
154151
lte_lc_init();
155152
#else

0 commit comments

Comments
 (0)