summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-05-24 20:11:50 +0700
committerGitHub <[email protected]>2023-05-24 20:11:50 +0700
commiteedafb23f727ac9408b43c6293f6c608f120993c (patch)
treec02298f8cd72e7f1420ebc19396399d0681d6520 /src
parent1ef820ecfe569e181b8f20cb936f632e51d8257e (diff)
parent57d2eb603b412a6bfbfdad7fb0bac854302b4351 (diff)
Merge pull request #2063 from abakosh/develop
fix(RA Host Portable): implement missing function __builtin_ctz(x)
Diffstat (limited to 'src')
-rw-r--r--src/portable/renesas/rusb2/hcd_rusb2.c2
-rw-r--r--src/portable/renesas/rusb2/rusb2_ra.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/portable/renesas/rusb2/hcd_rusb2.c b/src/portable/renesas/rusb2/hcd_rusb2.c
index e4743223e..0e6fa1618 100644
--- a/src/portable/renesas/rusb2/hcd_rusb2.c
+++ b/src/portable/renesas/rusb2/hcd_rusb2.c
@@ -407,7 +407,7 @@ static void process_pipe0_bemp(uint8_t rhport)
static void process_pipe_nrdy(uint8_t rhport, unsigned num)
{
(void)rhport;
- unsigned result;
+ xfer_result_t result;
uint16_t volatile *ctr = get_pipectr(num);
// TU_LOG1("NRDY %d %x\n", num, *ctr);
switch (*ctr & RUSB2_PIPE_CTR_PID_Msk) {
diff --git a/src/portable/renesas/rusb2/rusb2_ra.h b/src/portable/renesas/rusb2/rusb2_ra.h
index 5785850cc..5be9f11ce 100644
--- a/src/portable/renesas/rusb2/rusb2_ra.h
+++ b/src/portable/renesas/rusb2/rusb2_ra.h
@@ -36,6 +36,10 @@ extern "C" {
#define RUSB2_REG_BASE (0x40090000)
+#if defined(__ICCARM__)
+ #define __builtin_ctz(x) __iar_builtin_CLZ(__iar_builtin_RBIT(x))
+#endif
+
TU_ATTR_ALWAYS_INLINE static inline void rusb2_int_enable(uint8_t rhport)
{
(void) rhport;