Skip to content

Commit

Permalink
drivers: ieee802154: Fix problem with binding IRQ handlers in shim layer
Browse files Browse the repository at this point in the history
The shim layer could in some circumstances not be properly
configured which would result in an unbound radio interrupt
handler.

Signed-off-by: Rafał Kuźnia <[email protected]>
  • Loading branch information
e-rk authored and carlescufi committed Mar 5, 2021
1 parent dbd66c8 commit ff1594c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion drivers/ieee802154/Kconfig.nrf5
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ config IEEE802154_NRF5_INIT_PRIO
you know what you are doing.

config IEEE802154_NRF5_EXT_IRQ_MGMT
bool "Radio IRQ is managed by an external module"
bool
help
The driver may manage radio IRQs by itself, or use an external
radio IRQ provider. When radio IRQs are managed by an external
Expand Down
4 changes: 2 additions & 2 deletions drivers/ieee802154/ieee802154_nrf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static int nrf5_stop(const struct device *dev)
return 0;
}

#ifndef CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT
#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
static void nrf5_radio_irq(void *arg)
{
ARG_UNUSED(arg);
Expand All @@ -555,7 +555,7 @@ static void nrf5_irq_config(const struct device *dev)
{
ARG_UNUSED(dev);

#ifndef CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT
#if !IS_ENABLED(CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
IRQ_CONNECT(RADIO_IRQn, NRF_802154_IRQ_PRIORITY,
nrf5_radio_irq, NULL, 0);
irq_enable(RADIO_IRQn);
Expand Down
14 changes: 5 additions & 9 deletions modules/hal_nordic/nrf_802154/radio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,11 @@ zephyr_compile_definitions(
NRF_802154_ACK_TIMEOUT_ENABLED=1
)

if (CONFIG_IEEE802154_NRF5 OR NOT CONFIG_NRF_802154_SL_OPENSOURCE)
zephyr_compile_definitions(
NRF_802154_INTERNAL_RADIO_IRQ_HANDLING=0
)
else()
zephyr_compile_definitions(
NRF_802154_INTERNAL_RADIO_IRQ_HANDLING=1
)
endif()
if (NOT CONFIG_IEEE802154_NRF5 AND NOT CONFIG_IEEE802154_NRF5_EXT_IRQ_MGMT)
zephyr_compile_definitions(NRF_802154_INTERNAL_RADIO_IRQ_HANDLING=1)
else ()
zephyr_compile_definitions(NRF_802154_INTERNAL_RADIO_IRQ_HANDLING=0)
endif ()

if (CONFIG_NRF_802154_SL_OPENSOURCE OR CONFIG_SOC_SERIES_NRF53X)
zephyr_compile_definitions(
Expand Down

0 comments on commit ff1594c

Please sign in to comment.