Skip to content

Commit

Permalink
[platform] use OT_ASSERT instead of assert in PAL sources
Browse files Browse the repository at this point in the history
Co-authored-by: Suvesh Pratapa <[email protected]>
  • Loading branch information
lmnotran and suveshpratapa committed Nov 22, 2023
1 parent 69d80ac commit 6740d0c
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 97 deletions.
8 changes: 4 additions & 4 deletions src/src/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
*
*/

#include <assert.h>
#include <openthread-core-config.h>
#include <openthread-system.h>
#include <stdbool.h>
#include <stdint.h>
#include <openthread/platform/alarm-micro.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/diag.h>
#include "common/debug.hpp"
#include "common/logging.hpp"

#include "platform-efr32.h"
Expand Down Expand Up @@ -89,7 +89,7 @@ uint32_t otPlatAlarmMilliGetNow(void)

ticks = sl_sleeptimer_get_tick_count64();
status = sl_sleeptimer_tick64_to_ms(ticks, &now);
assert(status == SL_STATUS_OK);
OT_ASSERT(status == SL_STATUS_OK);
return (uint32_t)now;
}

Expand Down Expand Up @@ -131,7 +131,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
NULL,
0,
SL_SLEEPTIMER_NO_HIGH_PRECISION_HF_CLOCKS_REQUIRED_FLAG);
assert(status == SL_STATUS_OK);
OT_ASSERT(status == SL_STATUS_OK);
}
}

Expand Down Expand Up @@ -261,7 +261,7 @@ void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
else
{
status = RAIL_SetMultiTimer(&rail_timer, remaining, RAIL_TIME_DELAY, radioTimerExpired, NULL);
assert(status == RAIL_STATUS_NO_ERROR);
OT_ASSERT(status == RAIL_STATUS_NO_ERROR);
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/src/diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <openthread/platform/diag.h>
#include <openthread/platform/radio.h>
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "common/logging.hpp"

#include "diag.h"
Expand Down Expand Up @@ -232,7 +233,9 @@ static RAIL_Status_t stopTxStream(void)
// Since start transmit stream turn off the radio state,
// call the RAIL_StartRx to turn on radio
IgnoreError(RAIL_GetChannel(gRailHandle, &currentChannel));
assert(RAIL_StartRx(gRailHandle, currentChannel, &rxSchedulerInfo) == RAIL_STATUS_NO_ERROR);

status = RAIL_StartRx(gRailHandle, currentChannel, &rxSchedulerInfo);
OT_ASSERT(status == RAIL_STATUS_NO_ERROR);

exit:
return status;
Expand Down
1 change: 0 additions & 1 deletion src/src/ieee802154-packet-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "sl_packet_utils.h"
#include "sli_protocol_crypto.h"

#include <assert.h>
#include "common/code_utils.hpp"
#include "common/debug.hpp"
#include "crypto/aes_ccm.hpp"
Expand Down
Loading

0 comments on commit 6740d0c

Please sign in to comment.