forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mpsl: fem: add kconfig MPSL_FEM_INIT_PRIORITY
The nrf2220 and nrf2240 devices require that mpsl_fem_init operation happens before the initialization of I2C if the TWI interface is used with these devices. This was achieved by hardcoded 49 value which is less than default value of Kconfig option I2C_INIT_PRIORITY. This commit removes the magic value form SYS_INIT(..., 49) and introduces a new Kconfig option MPSL_FEM_INIT_PRIORITY. The default value for MPSL_FEM_INIT_PRIORITY in case of nrf2220 or nrf2240 with TWI is still hardcoded to 49 due to following limitations: 1) The Kconfig compiler does not allow compile-time calculation of default value like: config MPSL_FEM_INIT_PRIORITY default (I2C_INIT_PRIORITY-1) if ... 2) The third parameter of SYS_INIT must be a literal or come from a macro expanding to literal. It cannot expand to expression. So following is impossible: #define FEM_INIT_PRIO (CONFIG_I2C_INIT_PRIORITY - 1) SYS_INIT(mpsl_fem_init, POST_KERNEL, FEM_INIT_PRIO); Providing Kconfig option MPSL_FEM_INIT_PRIORITY with appropriate BUILD_ASSERT gives ability to have correct priority of FEM initialization in case the Kconfig I2C_INIT_PRIORITY is changed. For nrf21540_gpio, nrf21540_gpio_spi and simple_gpio the default value is equal to KERNEL_INIT_PRIORITY_DEVICE (no change in default value and behavior) is used. The SYS_INIT priority at which legacy forwarding of pins happens (mpsl_fem_host_init sys init priority) is intentionally not affected. Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
- Loading branch information
Showing
6 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters