Skip to content

Commit 7222e5e

Browse files
committed
fem_al: use nRF2220 temperature compensation if enabled
The nRF2220 temperature compensation is recently added. The protocols relying on the fem_al do not use the MPSL scheduler. In this case the function `mpsl_fem_nrf2220_temperature_changed_update_now` must be called by a protocol driver which for this case is the fem_al. Signed-off-by: Andrzej Kuros <[email protected]>
1 parent 7b2de56 commit 7222e5e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/fem_al/fem_al.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
#include <mpsl_fem_config_common.h>
2020
#include <mpsl_fem_protocol_api.h>
21+
#if defined(CONFIG_MPSL_FEM_NRF2220_TEMPERATURE_COMPENSATION) && \
22+
!defined(CONFIG_MPSL_FEM_NRF2220_TEMPERATURE_COMPENSATION_WITH_MPSL_SCHEDULER)
23+
#include <protocol/mpsl_fem_nrf2220_protocol_api.h>
24+
#endif
2125

2226
#include "fem_al/fem_al.h"
2327
#include "fem_interface.h"
@@ -186,6 +190,15 @@ int fem_tx_configure(uint32_t ramp_up_time)
186190

187191
fem_activate_event.event.timer.counter_period.end = ramp_up_time;
188192

193+
#if defined(CONFIG_MPSL_FEM_NRF2220_TEMPERATURE_COMPENSATION) && \
194+
!defined(CONFIG_MPSL_FEM_NRF2220_TEMPERATURE_COMPENSATION_WITH_MPSL_SCHEDULER)
195+
err = mpsl_fem_nrf2220_temperature_changed_update_now();
196+
if (err) {
197+
printk("mpsl_fem_nrf2220_temperature_changed_update_now failed (err %d)\n", err);
198+
return -EFAULT;
199+
}
200+
#endif
201+
189202
mpsl_fem_enable();
190203
err = mpsl_fem_pa_configuration_set(&fem_activate_event, &fem_deactivate_evt);
191204
if (err) {

0 commit comments

Comments
 (0)