fix build with rp2040 + max3421
- forward MAX3421_HOST=1 from makefile to cmake - add feather_rp2040_max3421 board to run with ci for rp2040 + max3421
This commit is contained in:
parent
66cdf6d097
commit
7910cc2981
|
@ -113,6 +113,7 @@ CFLAGS += -DBOARD_$(BOARD_UPPER)
|
||||||
ifeq (${MAX3421_HOST},1)
|
ifeq (${MAX3421_HOST},1)
|
||||||
SRC_C += src/portable/analog/max3421/hcd_max3421.c
|
SRC_C += src/portable/analog/max3421/hcd_max3421.c
|
||||||
CFLAGS += -DCFG_TUH_MAX3421=1
|
CFLAGS += -DCFG_TUH_MAX3421=1
|
||||||
|
CMAKE_DEFSYM += -DMAX3421_HOST=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Log level is mapped to TUSB DEBUG option
|
# Log level is mapped to TUSB DEBUG option
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
set(PICO_BOARD adafruit_feather_rp2040)
|
||||||
|
|
||||||
|
# Enable MAX3421E USB Host
|
||||||
|
set(MAX3421_HOST 1)
|
|
@ -676,19 +676,18 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t daddr, uint8_t ep_addr, uint8_t * buf
|
||||||
max3421_ep_t* ep = find_opened_ep(daddr, ep_num, ep_dir);
|
max3421_ep_t* ep = find_opened_ep(daddr, ep_num, ep_dir);
|
||||||
TU_VERIFY(ep);
|
TU_VERIFY(ep);
|
||||||
|
|
||||||
// control transfer can switch direction
|
if (ep_num == 0) {
|
||||||
ep->hxfr_bm.is_out = ep_dir ? 0u : 1u;
|
// control transfer can switch direction
|
||||||
|
ep->hxfr_bm.is_out = ep_dir ? 0 : 1;
|
||||||
|
ep->hxfr_bm.is_setup = 0;
|
||||||
|
ep->data_toggle = 1;
|
||||||
|
}
|
||||||
|
|
||||||
ep->buf = buffer;
|
ep->buf = buffer;
|
||||||
ep->total_len = buflen;
|
ep->total_len = buflen;
|
||||||
ep->xferred_len = 0;
|
ep->xferred_len = 0;
|
||||||
ep->state = EP_STATE_ATTEMPT_1;
|
ep->state = EP_STATE_ATTEMPT_1;
|
||||||
|
|
||||||
if (ep_num == 0) {
|
|
||||||
ep->hxfr_bm.is_setup = 0;
|
|
||||||
ep->data_toggle = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// carry out transfer if not busy
|
// carry out transfer if not busy
|
||||||
if (!atomic_flag_test_and_set(&_hcd_data.busy)) {
|
if (!atomic_flag_test_and_set(&_hcd_data.busy)) {
|
||||||
xact_generic(rhport, ep, true, false);
|
xact_generic(rhport, ep, true, false);
|
||||||
|
|
Loading…
Reference in New Issue