Skip to content

Commit

Permalink
compiler: add HAVE_EXPRESSION_STATEMENT macro for gcc
Browse files Browse the repository at this point in the history
this will open fast version of div_const which defined in:
include/nuttx/lib/math32.h
when meet 64/32 when use gcc compiling

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI committed Nov 4, 2024
1 parent 38fbb4e commit cb39a9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/risc-v/src/esp32c3-legacy/esp32c3_ble_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
{
int ret;
struct bt_sem_s *bt_sem = (struct bt_sem_s *)semphr;
uint32_t tick = MSEC2TICK(block_time_ms);

if (block_time_ms == OSI_FUNCS_TIME_BLOCKING)
{
Expand All @@ -922,7 +923,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
{
if (block_time_ms > 0)
{
ret = nxsem_tickwait(&bt_sem->sem, MSEC2TICK(block_time_ms));
ret = nxsem_tickwait(&bt_sem->sem, tick);
}
else
{
Expand All @@ -932,8 +933,7 @@ static int semphr_take_wrapper(void *semphr, uint32_t block_time_ms)

if (ret)
{
wlerr("ERROR: Failed to wait sem in %lu ticks. Error=%d\n",
MSEC2TICK(block_time_ms), ret);
wlerr("ERROR: Failed to wait sem in %lu ticks. Error=%d\n", tick, ret);
}

return esp_errno_trans(ret);
Expand Down
6 changes: 6 additions & 0 deletions include/nuttx/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,12 @@
# define tz_nonsecure_call __attribute__((cmse_nonsecure_call))
# endif

/* GCC support expression statement, a compound statement enclosed in
* parentheses may appear as an expression in GNU C.
*/

# define CONFIG_HAVE_EXPRESSION_STATEMENT 1

/* SDCC-specific definitions ************************************************/

#elif defined(SDCC) || defined(__SDCC)
Expand Down

0 comments on commit cb39a9b

Please sign in to comment.