Skip to content

Commit 244154e

Browse files
authored
Merge pull request hathach#1311 from Wini-Buh/CCRX_Ext
Solve problems with CCRX toolchain
2 parents 5b7a01b + 5414cf2 commit 244154e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/common/tusb_compiler.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@
7575
* Nth position is the same as the number of arguments
7676
* - ##__VA_ARGS__ is used to deal with 0 paramerter (swallows comma)
7777
*------------------------------------------------------------------*/
78-
#define TU_ARGS_NUM(...) _TU_NARG(_0, ##__VA_ARGS__,_RSEQ_N())
78+
#if !defined(__CCRX__)
79+
#define TU_ARGS_NUM(...) _TU_NARG(_0, ##__VA_ARGS__,_RSEQ_N())
80+
#else
81+
#define TU_ARGS_NUM(...) _TU_NARG(_0, __VA_ARGS__,_RSEQ_N())
82+
#endif
7983

8084
#define _TU_NARG(...) _GET_NTH_ARG(__VA_ARGS__)
8185
#define _GET_NTH_ARG( \

src/portable/renesas/usba/dcd_usba.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,11 @@ static bool process_pipe_xfer(int buffer_type, uint8_t ep_addr, void* buffer, ui
494494
while (USB0.D0FIFOSEL.BIT.CURPIPE) ; /* if CURPIPE bits changes, check written value */
495495
}
496496
} else {
497+
#if defined(__CCRX__)
498+
__evenaccess volatile reg_pipetre_t *pt = get_pipetre(num);
499+
#else
497500
volatile reg_pipetre_t *pt = get_pipetre(num);
501+
#endif
498502
if (pt) {
499503
const unsigned mps = edpt_max_packet_size(num);
500504
volatile uint16_t *ctr = get_pipectr(num);
@@ -715,11 +719,11 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
715719
*ctr = 0;
716720
unsigned cfg = (dir << 4) | epn;
717721
if (xfer == TUSB_XFER_BULK) {
718-
cfg |= USB_PIPECFG_BULK | USB_PIPECFG_SHTNAK | USB_PIPECFG_DBLB;
722+
cfg |= (USB_PIPECFG_BULK | USB_PIPECFG_SHTNAK | USB_PIPECFG_DBLB);
719723
} else if (xfer == TUSB_XFER_INTERRUPT) {
720724
cfg |= USB_PIPECFG_INT;
721725
} else {
722-
cfg |= USB_PIPECFG_ISO | USB_PIPECFG_DBLB;
726+
cfg |= (USB_PIPECFG_ISO | USB_PIPECFG_DBLB);
723727
}
724728
USB0.PIPECFG.WORD = cfg;
725729
USB0.BRDYSTS.WORD = 0x1FFu ^ TU_BIT(num);

0 commit comments

Comments
 (0)