Skip to content

Commit 57d2eb6

Browse files
author
Aladdin Bakosh
committed
fix(RA Host Portable): implement missing function __builtin_ctz(x) for IAR
1 parent f1bef8d commit 57d2eb6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/portable/renesas/rusb2/hcd_rusb2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static void process_pipe0_bemp(uint8_t rhport)
407407
static void process_pipe_nrdy(uint8_t rhport, unsigned num)
408408
{
409409
(void)rhport;
410-
unsigned result;
410+
xfer_result_t result;
411411
uint16_t volatile *ctr = get_pipectr(num);
412412
// TU_LOG1("NRDY %d %x\n", num, *ctr);
413413
switch (*ctr & RUSB2_PIPE_CTR_PID_Msk) {

src/portable/renesas/rusb2/rusb2_ra.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ extern "C" {
3636

3737
#define RUSB2_REG_BASE (0x40090000)
3838

39+
#if defined(__ICCARM__)
40+
#define __builtin_ctz(x) __iar_builtin_CLZ(__iar_builtin_RBIT(x))
41+
#endif
42+
3943
TU_ATTR_ALWAYS_INLINE static inline void rusb2_int_enable(uint8_t rhport)
4044
{
4145
(void) rhport;

0 commit comments

Comments
 (0)