Skip to content

Commit

Permalink
drivers: ieee802154_nrf5: energy_detected api change adjust
Browse files Browse the repository at this point in the history
The prototype of `nrf_802154_energy_detected` callout has changed.
This commit adjusts to this change.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
  • Loading branch information
ankuns authored and carlescufi committed Aug 20, 2023
1 parent 69ae6ce commit 04d3dcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/ieee802154/ieee802154_nrf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,15 +1127,13 @@ void nrf_802154_cca_failed(nrf_802154_cca_error_t error)
k_sem_give(&nrf5_data.cca_wait);
}

void nrf_802154_energy_detected(uint8_t result)
void nrf_802154_energy_detected(const nrf_802154_energy_detected_t *result)
{
if (nrf5_data.energy_scan_done != NULL) {
int16_t dbm;
energy_scan_done_cb_t callback = nrf5_data.energy_scan_done;

nrf5_data.energy_scan_done = NULL;
dbm = nrf_802154_dbm_from_energy_level_calculate(result);
callback(net_if_get_device(nrf5_data.iface), dbm);
callback(net_if_get_device(nrf5_data.iface), result->ed_dbm);
}
}

Expand Down
4 changes: 4 additions & 0 deletions modules/hal_nordic/nrf_802154/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ else()
target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_CARRIER_FUNCTIONS_ENABLED=0)
endif()

if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION)
target_compile_definitions(zephyr-802154-interface INTERFACE NRF_802154_ENERGY_DETECTED_VERSION=1)
endif()

set(NRF52_SERIES ${CONFIG_SOC_SERIES_NRF52X})
set(NRF53_SERIES ${CONFIG_SOC_SERIES_NRF53X})
set(SER_HOST ${CONFIG_NRF_802154_SER_HOST})
Expand Down

0 comments on commit 04d3dcb

Please sign in to comment.