diff --git a/examples/platforms/nrf52811/platform-config.h b/examples/platforms/nrf52811/platform-config.h index 19fce45fd..b9816a379 100644 --- a/examples/platforms/nrf52811/platform-config.h +++ b/examples/platforms/nrf52811/platform-config.h @@ -444,9 +444,7 @@ * */ #ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT #define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 #endif -#endif #endif // PLATFORM_CONFIG_H_ diff --git a/examples/platforms/nrf52811/radio.c b/examples/platforms/nrf52811/radio.c index a7c7bae98..6cf53b368 100644 --- a/examples/platforms/nrf52811/radio.c +++ b/examples/platforms/nrf52811/radio.c @@ -696,11 +696,7 @@ void nrf5RadioProcess(otInstance *aInstance) } } -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT void nrf_802154_received_timestamp_raw(uint8_t *p_data, int8_t power, uint8_t lqi, uint32_t time) -#else -void nrf_802154_received_raw(uint8_t *p_data, int8_t power, uint8_t lqi) -#endif { otRadioFrame *receivedFrame = NULL; @@ -733,17 +729,13 @@ void nrf_802154_received_raw(uint8_t *p_data, int8_t power, uint8_t lqi) receivedFrame->mInfo.mRxInfo.mAckedWithFramePending = false; } -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE // Get the timestamp when the SFD was received. +#if !NRF_802154_TX_STARTED_NOTIFY_ENABLED +#error "NRF_802154_TX_STARTED_NOTIFY_ENABLED is required!" +#endif uint32_t offset = (int32_t)otPlatAlarmMicroGetNow() - (int32_t)nrf_802154_first_symbol_timestamp_get(time, p_data[0]); - receivedFrame->mInfo.mRxInfo.mTimestamp = otPlatTimeGet() - offset; -#else - if (otPlatRadioGetPromiscuous(sInstance)) - { - receivedFrame->mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime(); - } -#endif + receivedFrame->mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime() - offset; sAckedWithFramePending = false; diff --git a/examples/platforms/nrf52840/platform-config.h b/examples/platforms/nrf52840/platform-config.h index 466a409e0..2c03707b1 100644 --- a/examples/platforms/nrf52840/platform-config.h +++ b/examples/platforms/nrf52840/platform-config.h @@ -461,9 +461,7 @@ * */ #ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT #define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 #endif -#endif #endif // PLATFORM_CONFIG_H_ diff --git a/examples/platforms/nrf52840/radio.c b/examples/platforms/nrf52840/radio.c index 159164c17..686789264 100644 --- a/examples/platforms/nrf52840/radio.c +++ b/examples/platforms/nrf52840/radio.c @@ -696,11 +696,7 @@ void nrf5RadioProcess(otInstance *aInstance) } } -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT void nrf_802154_received_timestamp_raw(uint8_t *p_data, int8_t power, uint8_t lqi, uint32_t time) -#else -void nrf_802154_received_raw(uint8_t *p_data, int8_t power, uint8_t lqi) -#endif { otRadioFrame *receivedFrame = NULL; @@ -733,17 +729,13 @@ void nrf_802154_received_raw(uint8_t *p_data, int8_t power, uint8_t lqi) receivedFrame->mInfo.mRxInfo.mAckedWithFramePending = false; } -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE // Get the timestamp when the SFD was received. +#if !NRF_802154_TX_STARTED_NOTIFY_ENABLED +#error "NRF_802154_TX_STARTED_NOTIFY_ENABLED is required!" +#endif uint32_t offset = (int32_t)otPlatAlarmMicroGetNow() - (int32_t)nrf_802154_first_symbol_timestamp_get(time, p_data[0]); - receivedFrame->mInfo.mRxInfo.mTimestamp = otPlatTimeGet() - offset; -#else - if (otPlatRadioGetPromiscuous(sInstance)) - { - receivedFrame->mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime(); - } -#endif + receivedFrame->mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime() - offset; sAckedWithFramePending = false;