mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-13 01:15:01 +00:00
more with -Wcast-qual
This commit is contained in:
parent
0b249618b0
commit
a5f516893b
@ -29,6 +29,9 @@ SRC_C += \
|
||||
$(FREERTOS_SRC)/timers.c \
|
||||
$(subst ../../../,,$(wildcard ../../../$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)/*.c))
|
||||
|
||||
# Suppress FreeRTOS warnings
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
# FreeRTOS (lto + Os) linker issue
|
||||
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
|
||||
|
||||
|
@ -28,6 +28,9 @@ SRC_C += \
|
||||
$(FREERTOS_SRC)/timers.c \
|
||||
$(subst ../../../,,$(wildcard ../../../$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)/*.c))
|
||||
|
||||
# Suppress FreeRTOS warnings
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
# FreeRTOS (lto + Os) linker issue
|
||||
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
|
||||
|
||||
|
@ -36,11 +36,12 @@
|
||||
|
||||
// List of supported sample rates
|
||||
#if defined(__RX__)
|
||||
const uint32_t sample_rates[] = {44100, 48000};
|
||||
const uint32_t sample_rates[] = {44100, 48000};
|
||||
#else
|
||||
const uint32_t sample_rates[] = {44100, 48000, 88200, 96000};
|
||||
const uint32_t sample_rates[] = {44100, 48000, 88200, 96000};
|
||||
#endif
|
||||
uint32_t current_sample_rate = 44100;
|
||||
|
||||
uint32_t current_sample_rate = 44100;
|
||||
|
||||
#define N_SAMPLE_RATES TU_ARRAY_SIZE(sample_rates)
|
||||
|
||||
@ -202,7 +203,7 @@ static bool tud_audio_clock_set_request(uint8_t rhport, audio_control_request_t
|
||||
{
|
||||
TU_VERIFY(request->wLength == sizeof(audio_control_cur_4_t));
|
||||
|
||||
current_sample_rate = ((audio_control_cur_4_t *)buf)->bCur;
|
||||
current_sample_rate = ((audio_control_cur_4_t const *)buf)->bCur;
|
||||
|
||||
TU_LOG1("Clock set current freq: %d\r\n", current_sample_rate);
|
||||
|
||||
@ -264,7 +265,7 @@ static bool tud_audio_feature_unit_set_request(uint8_t rhport, audio_control_req
|
||||
{
|
||||
TU_VERIFY(request->wLength == sizeof(audio_control_cur_1_t));
|
||||
|
||||
mute[request->bChannelNumber] = ((audio_control_cur_1_t *)buf)->bCur;
|
||||
mute[request->bChannelNumber] = ((audio_control_cur_1_t const *)buf)->bCur;
|
||||
|
||||
TU_LOG1("Set channel %d Mute: %d\r\n", request->bChannelNumber, mute[request->bChannelNumber]);
|
||||
|
||||
@ -295,7 +296,7 @@ static bool tud_audio_feature_unit_set_request(uint8_t rhport, audio_control_req
|
||||
// Invoked when audio class specific get request received for an entity
|
||||
bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *p_request)
|
||||
{
|
||||
audio_control_request_t *request = (audio_control_request_t *)p_request;
|
||||
audio_control_request_t const *request = (audio_control_request_t const *)p_request;
|
||||
|
||||
if (request->bEntityID == UAC2_ENTITY_CLOCK)
|
||||
return tud_audio_clock_get_request(rhport, request);
|
||||
|
@ -166,7 +166,7 @@ void video_task(void)
|
||||
already_sent = 1;
|
||||
start_ms = board_millis();
|
||||
#ifdef CFG_EXAMPLE_VIDEO_READONLY
|
||||
tud_video_n_frame_xfer(0, 0, (void*)&frame_buffer[(frame_num % (FRAME_WIDTH / 2)) * 4],
|
||||
tud_video_n_frame_xfer(0, 0, (void*)(uintptr_t) &frame_buffer[(frame_num % (FRAME_WIDTH / 2)) * 4],
|
||||
FRAME_WIDTH * FRAME_HEIGHT * 16/8);
|
||||
#else
|
||||
fill_color_bar(frame_buffer, frame_num);
|
||||
@ -180,7 +180,7 @@ void video_task(void)
|
||||
start_ms += interval_ms;
|
||||
|
||||
#ifdef CFG_EXAMPLE_VIDEO_READONLY
|
||||
tud_video_n_frame_xfer(0, 0, (void*)&frame_buffer[(frame_num % (FRAME_WIDTH / 2)) * 4],
|
||||
tud_video_n_frame_xfer(0, 0, (void*)(uintptr_t) &frame_buffer[(frame_num % (FRAME_WIDTH / 2)) * 4],
|
||||
FRAME_WIDTH * FRAME_HEIGHT * 16/8);
|
||||
#else
|
||||
fill_color_bar(frame_buffer, frame_num);
|
||||
|
@ -179,7 +179,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
|
||||
case VENDOR_REQUEST_WEBUSB:
|
||||
// match vendor request in BOS descriptor
|
||||
// Get landing page url
|
||||
return tud_control_xfer(rhport, request, (void*) &desc_url, desc_url.bLength);
|
||||
return tud_control_xfer(rhport, request, (void*)(uintptr_t) &desc_url, desc_url.bLength);
|
||||
|
||||
case VENDOR_REQUEST_MICROSOFT:
|
||||
if ( request->wIndex == 7 )
|
||||
@ -188,7 +188,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
|
||||
uint16_t total_len;
|
||||
memcpy(&total_len, desc_ms_os_20+8, 2);
|
||||
|
||||
return tud_control_xfer(rhport, request, (void*) desc_ms_os_20, total_len);
|
||||
return tud_control_xfer(rhport, request, (void*)(uintptr_t) desc_ms_os_20, total_len);
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
|
@ -104,7 +104,8 @@ CFLAGS += \
|
||||
-Wmissing-format-attribute \
|
||||
-Wunreachable-code \
|
||||
-Wcast-align \
|
||||
-Wcast-function-type
|
||||
-Wcast-function-type \
|
||||
-Wcast-qual
|
||||
|
||||
# Debugging/Optimization
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
@ -101,9 +101,14 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
int32_t offset = 0;
|
||||
uint8_t const* buf8 = (uint8_t const*) buf;
|
||||
for (offset = 0; offset < len; offset++)
|
||||
if (! (messible_status_read() & CSR_MESSIBLE_STATUS_FULL_OFFSET))
|
||||
messible_in_write(((uint8_t *)buf)[offset]);
|
||||
{
|
||||
if (!(messible_status_read() & CSR_MESSIBLE_STATUS_FULL_OFFSET))
|
||||
{
|
||||
messible_in_write(buf8[offset]);
|
||||
}
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ int board_uart_write(void const* buf, int len) {
|
||||
#if defined(UART_DEV)
|
||||
int txsize = len;
|
||||
while (txsize--) {
|
||||
usart_write(UART_DEV, *(uint8_t*)buf);
|
||||
usart_write(UART_DEV, *(uint8_t const*)buf);
|
||||
buf++;
|
||||
}
|
||||
return len;
|
||||
|
@ -172,7 +172,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
LPUART_WriteBlocking(UART_PORT, (uint8_t*)buf, len);
|
||||
LPUART_WriteBlocking(UART_PORT, (uint8_t const*)buf, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ CFLAGS += \
|
||||
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
|
||||
|
||||
# mcu driver cause following warnings
|
||||
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable
|
||||
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
|
||||
|
||||
MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
|
||||
|
||||
|
@ -13,7 +13,7 @@ CFLAGS += \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
|
||||
|
||||
# mcu driver cause following warnings
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
|
||||
|
||||
MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
|
||||
|
||||
|
@ -210,7 +210,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
|
||||
USART_WriteBlocking(UART_DEV, (uint8_t const *) buf, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
|
||||
USART_WriteBlocking(UART_DEV, (uint8_t const *) buf, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ CFLAGS += \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_MM32F327X
|
||||
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c \
|
||||
|
@ -228,7 +228,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const *buf, int len)
|
||||
{
|
||||
sci0_buf[0].buf = (uint8_t*)buf;
|
||||
sci0_buf[0].buf = (uint8_t*)(uintptr_t) buf;
|
||||
sci0_buf[0].cnt = len;
|
||||
SCI0.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
|
||||
while (SCI0.SCR.BIT.TE) ;
|
||||
|
@ -273,7 +273,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const *buf, int len)
|
||||
{
|
||||
sci_buf[0].buf = (uint8_t*)buf;
|
||||
sci_buf[0].buf = (uint8_t*)(uintptr_t) buf;
|
||||
sci_buf[0].cnt = len;
|
||||
SCI5.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
|
||||
while (SCI5.SCR.BIT.TE) ;
|
||||
|
@ -11,6 +11,9 @@ CFLAGS += \
|
||||
-DOSC32K_OVERWRITE_CALIBRATION=0 \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_SAMD11
|
||||
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/microchip/samd/dcd_samd.c \
|
||||
hw/mcu/microchip/samd11/gcc/gcc/startup_samd11.c \
|
||||
|
@ -12,6 +12,9 @@ CFLAGS += \
|
||||
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
|
||||
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/microchip/samd/dcd_samd.c \
|
||||
hw/mcu/microchip/samd21/gcc/gcc/startup_samd21.c \
|
||||
|
@ -13,7 +13,8 @@ CFLAGS += \
|
||||
-nostdlib -nostartfiles \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
|
||||
|
||||
CFLAGS += -Wno-error=undef
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/microchip/samd/dcd_samd.c \
|
||||
|
@ -13,6 +13,9 @@ CFLAGS += \
|
||||
-DCONF_OSC32K_CALIB_ENABLE=0 \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_SAML22
|
||||
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/microchip/samd/dcd_samd.c \
|
||||
$(MCU_DIR)/gcc/gcc/startup_$(SAML_VARIANT).c \
|
||||
|
@ -134,7 +134,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ CFLAGS += \
|
||||
-DCFG_TUSB_MCU=OPT_MCU_STM32F0
|
||||
|
||||
# suppress warning caused by vendor mcu driver
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
|
||||
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual
|
||||
|
||||
SRC_C += \
|
||||
src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
|
||||
|
@ -160,7 +160,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
#ifdef UART_DEV
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
|
||||
return len;
|
||||
#else
|
||||
(void) buf; (void) len; (void) UartHandle;
|
||||
|
@ -284,7 +284,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ int board_uart_read(uint8_t* buf, int len)
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ bool tuh_cdc_send(uint8_t dev_addr, void const * p_data, uint32_t length, bool i
|
||||
uint8_t const ep_out = cdch_data[dev_addr-1].ep_out;
|
||||
if ( usbh_edpt_busy(dev_addr, ep_out) ) return false;
|
||||
|
||||
return usbh_edpt_xfer(dev_addr, ep_out, (void *) p_data, length);
|
||||
return usbh_edpt_xfer(dev_addr, ep_out, (void*)(uintptr_t) p_data, length);
|
||||
}
|
||||
|
||||
bool tuh_cdc_receive(uint8_t dev_addr, void * p_buffer, uint32_t length, bool is_notify)
|
||||
|
@ -263,7 +263,7 @@ bool tuh_msc_write10(uint8_t dev_addr, uint8_t lun, void const * buffer, uint32_
|
||||
|
||||
memcpy(cbw.command, &cmd_write10, cbw.cmd_len);
|
||||
|
||||
return tuh_msc_scsi_command(dev_addr, &cbw, (void*) buffer, complete_cb);
|
||||
return tuh_msc_scsi_command(dev_addr, &cbw, (void*)(uintptr_t) buffer, complete_cb);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -1002,7 +1002,7 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
||||
tusb_control_request_t mod_request = *p_request;
|
||||
mod_request.wLength = CFG_TUD_ENDPOINT0_SIZE;
|
||||
|
||||
tud_control_xfer(rhport, &mod_request, desc_device, CFG_TUD_ENDPOINT0_SIZE);
|
||||
return tud_control_xfer(rhport, &mod_request, desc_device, CFG_TUD_ENDPOINT0_SIZE);
|
||||
}else
|
||||
{
|
||||
return tud_control_xfer(rhport, p_request, desc_device, sizeof(tusb_desc_device_t));
|
||||
|
@ -894,11 +894,10 @@ static bool enum_get_9byte_config_desc_complete(uint8_t dev_addr, tusb_control_r
|
||||
TU_ASSERT(XFER_RESULT_SUCCESS == result);
|
||||
|
||||
// TODO not enough buffer to hold configuration descriptor
|
||||
tusb_desc_configuration_t const * desc_config = (tusb_desc_configuration_t const*) _usbh_ctrl_buf;
|
||||
uint16_t total_len;
|
||||
uint8_t const * desc_config = _usbh_ctrl_buf;
|
||||
|
||||
// Use offsetof to avoid pointer to the odd/misaligned address
|
||||
memcpy(&total_len, (uint8_t*) desc_config + offsetof(tusb_desc_configuration_t, wTotalLength), 2);
|
||||
uint16_t const total_len = tu_le16toh( tu_unaligned_read16(desc_config + offsetof(tusb_desc_configuration_t, wTotalLength)) );
|
||||
|
||||
TU_ASSERT(total_len <= CFG_TUH_ENUMERATION_BUFSIZE);
|
||||
|
||||
|
@ -128,7 +128,7 @@ static inline ehci_qtd_t* qtd_find_free (void);
|
||||
static inline ehci_qtd_t* qtd_next (ehci_qtd_t const * p_qtd);
|
||||
static inline void qtd_insert_to_qhd (ehci_qhd_t *p_qhd, ehci_qtd_t *p_qtd_new);
|
||||
static inline void qtd_remove_1st_from_qhd (ehci_qhd_t *p_qhd);
|
||||
static void qtd_init (ehci_qtd_t* p_qtd, void* buffer, uint16_t total_bytes);
|
||||
static void qtd_init (ehci_qtd_t* p_qtd, void const* buffer, uint16_t total_bytes);
|
||||
|
||||
static inline void list_insert (ehci_link_t *current, ehci_link_t *new, uint8_t new_type);
|
||||
static inline ehci_link_t* list_next (ehci_link_t *p_link_pointer);
|
||||
@ -392,7 +392,7 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet
|
||||
ehci_qhd_t* qhd = &ehci_data.control[dev_addr].qhd;
|
||||
ehci_qtd_t* td = &ehci_data.control[dev_addr].qtd;
|
||||
|
||||
qtd_init(td, (void*) setup_packet, 8);
|
||||
qtd_init(td, setup_packet, 8);
|
||||
td->pid = EHCI_PID_SETUP;
|
||||
td->int_on_complete = 1;
|
||||
td->next.terminate = 1;
|
||||
@ -857,7 +857,7 @@ static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t c
|
||||
}
|
||||
}
|
||||
|
||||
static void qtd_init(ehci_qtd_t* p_qtd, void* buffer, uint16_t total_bytes)
|
||||
static void qtd_init(ehci_qtd_t* p_qtd, void const* buffer, uint16_t total_bytes)
|
||||
{
|
||||
tu_memclr(p_qtd, sizeof(ehci_qtd_t));
|
||||
|
||||
|
@ -636,7 +636,7 @@ void dcd_int_handler(uint8_t rhport)
|
||||
// 23.10.10.2 Operational model for setup transfers
|
||||
dcd_reg->ENDPTSETUPSTAT = dcd_reg->ENDPTSETUPSTAT;
|
||||
|
||||
dcd_event_setup_received(rhport, (uint8_t*) &_dcd_data.qhd[0][0].setup_request, true);
|
||||
dcd_event_setup_received(rhport, (uint8_t*)(uintptr_t) &_dcd_data.qhd[0][0].setup_request, true);
|
||||
}
|
||||
|
||||
// 23.10.12.3 Failed QTD also get ENDPTCOMPLETE set
|
||||
|
@ -259,7 +259,7 @@ static inline void pipe_wait_for_ready(unsigned num)
|
||||
|
||||
static void pipe_write_packet(void *buf, volatile void *fifo, unsigned len)
|
||||
{
|
||||
hw_fifo_t *reg = (hw_fifo_t*)fifo;
|
||||
volatile hw_fifo_t *reg = (volatile hw_fifo_t*) fifo;
|
||||
uintptr_t addr = (uintptr_t)buf;
|
||||
while (len >= 2) {
|
||||
reg->u16 = *(const uint16_t *)addr;
|
||||
@ -275,7 +275,7 @@ static void pipe_write_packet(void *buf, volatile void *fifo, unsigned len)
|
||||
static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
|
||||
{
|
||||
uint8_t *p = (uint8_t*)buf;
|
||||
uint8_t *reg = (uint8_t*)fifo; /* byte access is always at base register address */
|
||||
volatile uint8_t *reg = (volatile uint8_t*)fifo; /* byte access is always at base register address */
|
||||
while (len--) *p++ = *reg;
|
||||
}
|
||||
|
||||
|
@ -976,7 +976,7 @@ static void handle_rxflvl_ints(uint8_t rhport, USB_OTG_OUTEndpointTypeDef * out_
|
||||
if (xfer->ff)
|
||||
{
|
||||
// Ring buffer
|
||||
tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *) rx_fifo, bcnt);
|
||||
tu_fifo_write_n_const_addr_full_words(xfer->ff, (const void *)(uintptr_t) rx_fifo, bcnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1096,7 +1096,7 @@ static void handle_epin_ints(uint8_t rhport, USB_OTG_DeviceTypeDef * dev, USB_OT
|
||||
if (xfer->ff)
|
||||
{
|
||||
usb_fifo_t tx_fifo = FIFO_BASE(rhport, n);
|
||||
tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *) tx_fifo, packet_size);
|
||||
tu_fifo_read_n_const_addr_full_words(xfer->ff, (void *)(uintptr_t) tx_fifo, packet_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -314,13 +314,13 @@ static void dcd_reset(void)
|
||||
usb_in_ctrl_write(1 << CSR_USB_IN_CTRL_RESET_OFFSET);
|
||||
usb_out_ctrl_write(1 << CSR_USB_OUT_CTRL_RESET_OFFSET);
|
||||
|
||||
memset((void *)rx_buffer, 0, sizeof(rx_buffer));
|
||||
memset((void *)rx_buffer_max, 0, sizeof(rx_buffer_max));
|
||||
memset((void *)rx_buffer_offset, 0, sizeof(rx_buffer_offset));
|
||||
memset((void *)(uintptr_t) rx_buffer, 0, sizeof(rx_buffer));
|
||||
memset((void *)(uintptr_t) rx_buffer_max, 0, sizeof(rx_buffer_max));
|
||||
memset((void *)(uintptr_t) rx_buffer_offset, 0, sizeof(rx_buffer_offset));
|
||||
|
||||
memset((void *)tx_buffer, 0, sizeof(tx_buffer));
|
||||
memset((void *)tx_buffer_max, 0, sizeof(tx_buffer_max));
|
||||
memset((void *)tx_buffer_offset, 0, sizeof(tx_buffer_offset));
|
||||
memset((void *)(uintptr_t) tx_buffer, 0, sizeof(tx_buffer));
|
||||
memset((void *)(uintptr_t) tx_buffer_max, 0, sizeof(tx_buffer_max));
|
||||
memset((void *)(uintptr_t) tx_buffer_offset, 0, sizeof(tx_buffer_offset));
|
||||
tx_ep = 0;
|
||||
tx_active = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user