diff --git a/demos/bsp/boards/printf_retarget.c b/demos/bsp/boards/printf_retarget.c index 5d72c1bd8..fc6db7c90 100644 --- a/demos/bsp/boards/printf_retarget.c +++ b/demos/bsp/boards/printf_retarget.c @@ -108,7 +108,7 @@ int __sys_readc (void) #elif defined __CC_ARM // keil #if CFG_PRINTF_TARGET == PRINTF_TARGET_UART - #define retarget_putc(c) board_uart_send(&c, 1); + #define retarget_putc(c) board_uart_send( (uint8_t*) &c, 1); #elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO #define retarget_putc(c) ITM_SendChar(c) #else @@ -126,7 +126,7 @@ int fputc(int ch, FILE *f) if (//CFG_PRINTF_NEWLINE[0] == '\r' && ch == '\n') { - const uint8_t carry = '\r'; + uint8_t carry = '\r'; retarget_putc(carry); } @@ -140,7 +140,7 @@ void _ttywrch(int ch) if (//CFG_PRINTF_NEWLINE[0] == '\r' && ch == '\n') { - const uint8_t carry = '\r'; + uint8_t carry = '\r'; retarget_putc(carry); } diff --git a/demos/host/host_freertos/host_freertos.uvopt b/demos/host/host_freertos/host_freertos.uvopt index e90c14dc5..83d554cf5 100644 --- a/demos/host/host_freertos/host_freertos.uvopt +++ b/demos/host/host_freertos/host_freertos.uvopt @@ -331,7 +331,7 @@ 0 0 0 - 95 + 96 102 0 ..\src\main.c @@ -379,8 +379,8 @@ 0 0 0 - 40 - 47 + 41 + 50 0 ..\src\mouse_app.c mouse_app.c @@ -833,9 +833,9 @@ 1 0 0 - 50 + 51 0 - 344 + 348 355 0 ..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_uart.c @@ -939,7 +939,7 @@ 0 0 0 - 148 + 149 151 0 ..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s @@ -1075,7 +1075,7 @@ 0 27 0 - 10 + 22 29 0 ..\..\..\vendor\freertos\freertos\Source\portable\RVDS\ARM_CM4F\port.c diff --git a/demos/host/host_freertos/host_freertos.uvproj b/demos/host/host_freertos/host_freertos.uvproj index 85356c9a4..f7a4215a4 100644 --- a/demos/host/host_freertos/host_freertos.uvproj +++ b/demos/host/host_freertos/host_freertos.uvproj @@ -347,7 +347,7 @@ 0 0 - --gnu --c99 + --gnu --c99 --diag_suppress=66 CORE_M4 MCU=MCU_LPC43XX BOARD=BOARD_EA4357 TUSB_CFG_OS=TUSB_OS_FREERTOS TUSB_CFG_OS_TASK_PRIO=configMAX_PRIORITIES-5 ..\src;..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\inc;..\..\bsp;..\..\..\tinyusb;..\..\..\vendor\freertos;..\..\..\vendor\freertos\freertos\Source\include;..\host_freertos diff --git a/demos/host/host_os_none/.cproject b/demos/host/host_os_none/.cproject index bf2da444e..e7a18e701 100644 --- a/demos/host/host_os_none/.cproject +++ b/demos/host/host_os_none/.cproject @@ -82,7 +82,7 @@ - + @@ -1193,7 +1193,7 @@ - + @@ -2301,7 +2301,7 @@ - + @@ -3409,7 +3409,7 @@ - + @@ -4514,7 +4514,7 @@ - + diff --git a/demos/host/host_os_none/host_os_none.uvopt b/demos/host/host_os_none/host_os_none.uvopt index bc8d0522b..13f68cbc4 100644 --- a/demos/host/host_os_none/host_os_none.uvopt +++ b/demos/host/host_os_none/host_os_none.uvopt @@ -387,10 +387,10 @@ 1 0 0 - 52 + 0 0 - 63 - 73 + 118 + 158 0 ..\src\main.c main.c @@ -403,10 +403,10 @@ 1 0 0 - 24 + 0 0 - 0 - 0 + 84 + 124 0 ..\src\cdc_serial_app.c cdc_serial_app.c @@ -491,10 +491,10 @@ 1 0 0 - 0 + 2 0 - 0 - 0 + 128 + 146 0 ..\..\bsp\boards\embedded_artists\board_ea4357.c board_ea4357.c @@ -507,10 +507,10 @@ 1 0 0 - 2 + 1 0 - 0 - 0 + 97 + 106 0 ..\..\bsp\boards\printf_retarget.c printf_retarget.c @@ -707,10 +707,10 @@ 1 0 0 - 1 + 0 0 - 0 - 0 + 170 + 210 0 ..\..\..\tinyusb\host\usbh.c usbh.c @@ -725,8 +725,8 @@ 0 0 0 - 0 - 0 + 262 + 254 0 ..\..\..\tinyusb\host\ehci\ehci.c ehci.c @@ -773,8 +773,8 @@ 0 0 0 - 0 - 0 + 29 + 69 0 ..\..\..\tinyusb\hal\hal_lpc43xx.c hal_lpc43xx.c @@ -837,8 +837,8 @@ 0 0 0 - 0 - 0 + 102 + 142 0 ..\..\..\tinyusb\class\cdc_host.c cdc_host.c @@ -851,10 +851,10 @@ 1 0 0 - 39 + 24 0 - 0 - 0 + 135 + 152 0 ..\..\..\tinyusb\class\cdc_rndis_host.c cdc_rndis_host.c diff --git a/demos/host/host_os_none/host_os_none.uvproj b/demos/host/host_os_none/host_os_none.uvproj index 9b643b5e1..1de4faabd 100644 --- a/demos/host/host_os_none/host_os_none.uvproj +++ b/demos/host/host_os_none/host_os_none.uvproj @@ -347,7 +347,7 @@ 0 0 - --gnu --c99 + --gnu --c99 --diag_suppress=66 CORE_M4 MCU=MCU_LPC43XX BOARD=BOARD_EA4357 TUSB_CFG_OS=TUSB_OS_NONE ..\src;..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\inc;..\..\bsp;..\..\..\tinyusb diff --git a/demos/host/src/mouse_app.c b/demos/host/src/mouse_app.c index 425be056f..666aa02f5 100644 --- a/demos/host/src/mouse_app.c +++ b/demos/host/src/mouse_app.c @@ -74,7 +74,7 @@ void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr) printf("a mouse device is mounted\n"); osal_queue_flush(queue_mouse_hdl); - tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // first report + (void) tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // first report } void tusbh_hid_mouse_unmounted_isr(uint8_t dev_addr) @@ -88,11 +88,11 @@ void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event) { case TUSB_EVENT_XFER_COMPLETE: osal_queue_send(queue_mouse_hdl, &usb_mouse_report); - tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); + (void) tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); break; case TUSB_EVENT_XFER_ERROR: - tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // ignore & continue + (void) tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // ignore & continue break; default : diff --git a/tinyusb/class/cdc_host.c b/tinyusb/class/cdc_host.c index 49899c63b..c15140ea8 100644 --- a/tinyusb/class/cdc_host.c +++ b/tinyusb/class/cdc_host.c @@ -76,8 +76,8 @@ static inline cdc_pipeid_t get_app_pipeid(pipe_handle_t pipe_hdl) cdch_data_t const * p_cdc = &cdch_data[pipe_hdl.dev_addr-1]; return pipehandle_is_equal( pipe_hdl, p_cdc->pipe_notification ) ? CDC_PIPE_NOTIFICATION : - pipehandle_is_equal( pipe_hdl, p_cdc->pipe_in ) ? CDC_PIPE_DATA_IN : - pipehandle_is_equal( pipe_hdl, p_cdc->pipe_out ) ? CDC_PIPE_DATA_OUT : 0; + pipehandle_is_equal( pipe_hdl, p_cdc->pipe_in ) ? CDC_PIPE_DATA_IN : + pipehandle_is_equal( pipe_hdl, p_cdc->pipe_out ) ? CDC_PIPE_DATA_OUT : CDC_PIPE_ERROR; } //--------------------------------------------------------------------+ diff --git a/tinyusb/class/cdc_host.h b/tinyusb/class/cdc_host.h index 9d6c559c6..159d27856 100644 --- a/tinyusb/class/cdc_host.h +++ b/tinyusb/class/cdc_host.h @@ -55,6 +55,7 @@ #endif typedef enum { + CDC_PIPE_ERROR, CDC_PIPE_NOTIFICATION = 1, CDC_PIPE_DATA_IN, CDC_PIPE_DATA_OUT diff --git a/tinyusb/class/hid_host.h b/tinyusb/class/hid_host.h index a61a66e70..c8ace4eca 100644 --- a/tinyusb/class/hid_host.h +++ b/tinyusb/class/hid_host.h @@ -60,7 +60,7 @@ extern uint8_t const hid_keycode_to_ascii_tbl[2][128]; // TODO used weak attr if build failed without KEYBOARD enabled bool tusbh_hid_keyboard_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT; -tusb_error_t tusbh_hid_keyboard_get_report(uint8_t dev_addr, void * report) ATTR_WARN_UNUSED_RESULT; +tusb_error_t tusbh_hid_keyboard_get_report(uint8_t dev_addr, void * report) /*ATTR_WARN_UNUSED_RESULT*/; tusb_interface_status_t tusbh_hid_keyboard_status(uint8_t dev_addr) ATTR_WARN_UNUSED_RESULT; //------------- Application Callback -------------// void tusbh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event) ATTR_WEAK; @@ -71,7 +71,7 @@ void tusbh_hid_keyboard_unmounted_isr(uint8_t dev_addr) ATTR_WEAK; // MOUSE Application API //--------------------------------------------------------------------+ bool tusbh_hid_mouse_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT; -tusb_error_t tusbh_hid_mouse_get_report(uint8_t dev_addr, void* report) ATTR_WARN_UNUSED_RESULT; +tusb_error_t tusbh_hid_mouse_get_report(uint8_t dev_addr, void* report) /*ATTR_WARN_UNUSED_RESULT*/; tusb_interface_status_t tusbh_hid_mouse_status(uint8_t dev_addr) ATTR_WARN_UNUSED_RESULT; //------------- Application Callback -------------// void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event) ATTR_WEAK; diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 7a5b2ff78..853f33e67 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -248,12 +248,12 @@ static inline void osal_mutex_reset(osal_mutex_handle_t mutex_hdl) // QUEUE API //--------------------------------------------------------------------+ typedef struct{ - void * const buffer ; ///< buffer pointer - uint8_t const depth ; ///< max items - uint8_t const item_size ; ///< size of each item - volatile uint8_t count ; ///< number of items in queue - volatile uint8_t wr_idx ; ///< write pointer - volatile uint8_t rd_idx ; ///< read pointer + uint8_t* const buffer ; ///< buffer pointer + uint8_t const depth ; ///< max items + uint8_t const item_size ; ///< size of each item + volatile uint8_t count ; ///< number of items in queue + volatile uint8_t wr_idx ; ///< write pointer + volatile uint8_t rd_idx ; ///< read pointer } osal_queue_t; typedef osal_queue_t * osal_queue_handle_t; @@ -262,7 +262,7 @@ typedef osal_queue_t * osal_queue_handle_t; #define OSAL_QUEUE_DEF(name, queue_depth, type)\ type name##_buffer[queue_depth];\ osal_queue_t name = {\ - .buffer = name##_buffer,\ + .buffer = (uint8_t*) name##_buffer,\ .depth = queue_depth,\ .item_size = sizeof(type)\ }