diff --git a/boards/embedded_artists/ea4357/board_ea4357.c b/boards/embedded_artists/ea4357/board_ea4357.c index d0ac98be..ce38a692 100644 --- a/boards/embedded_artists/ea4357/board_ea4357.c +++ b/boards/embedded_artists/ea4357/board_ea4357.c @@ -45,7 +45,7 @@ #define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD #define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD -const static struct { +static const struct { uint8_t mux_port; uint8_t mux_pin; diff --git a/demos/host/src/cdc_serial_app.c b/demos/host/src/cdc_serial_app.c index 208cb28a..6c9e2359 100644 --- a/demos/host/src/cdc_serial_app.c +++ b/demos/host/src/cdc_serial_app.c @@ -86,16 +86,15 @@ void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_ case TUSB_EVENT_XFER_COMPLETE: received_bytes = xferred_bytes; osal_semaphore_post(sem_hdl); // notify main task - break; + break; case TUSB_EVENT_XFER_ERROR: received_bytes = 0; // ignore - break; + break; case TUSB_EVENT_XFER_STALLED: default : - ASSERT(false, VOID_RETURN); - break; + break; } break; diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c index 6abf1467..b3bdb396 100644 --- a/demos/host/src/cli.c +++ b/demos/host/src/cli.c @@ -92,7 +92,7 @@ static char const * const cli_error_message[] = #define CLI_PROTOTYPE_EXPAND(command, function, description) \ cli_error_t function(char * p_para); -CLI_COMMAND_TABLE(CLI_PROTOTYPE_EXPAND); +CLI_COMMAND_TABLE(CLI_PROTOTYPE_EXPAND) //--------------------------------------------------------------------+ // Expand to enum value diff --git a/demos/host/src/keyboard_app.c b/demos/host/src/keyboard_app.c index 07e65ce7..a6631a76 100644 --- a/demos/host/src/keyboard_app.c +++ b/demos/host/src/keyboard_app.c @@ -133,14 +133,11 @@ OSAL_TASK_FUNCTION( keyboard_app_task ) (void* p_task_para) //--------------------------------------------------------------------+ // look up new key in previous keys -static inline bool is_key_in_report(hid_keyboard_report_t const *p_report, uint8_t modifier, uint8_t keycode) +static inline bool is_key_in_report(hid_keyboard_report_t const *p_report, uint8_t keycode) { for(uint8_t i=0; i<6; i++) { - if (p_report->keycode[i] == keycode) - { - return true; - } + if (p_report->keycode[i] == keycode) return true; } return false; @@ -148,19 +145,19 @@ static inline bool is_key_in_report(hid_keyboard_report_t const *p_report, uint8 static inline void process_kbd_report(hid_keyboard_report_t const *p_new_report) { - static hid_keyboard_report_t prev_report = { 0 }; // previous report to check key released + static hid_keyboard_report_t prev_report = { 0, 0, {0} }; // previous report to check key released //------------- example code ignore control (non-printable) key affects -------------// for(uint8_t i=0; i<6; i++) { if ( p_new_report->keycode[i] ) { - if ( is_key_in_report(&prev_report, p_new_report->modifier, p_new_report->keycode[i]) ) + if ( is_key_in_report(&prev_report, p_new_report->keycode[i]) ) { - // previously existed means holding + // exist in previous report means the current key is holding }else { - // previously non-existed means key is pressed + // not exist in previous report means the current key is pressed uint8_t ch = keycode_to_ascii(p_new_report->modifier, p_new_report->keycode[i]); putchar(ch); if ( ch == '\r' ) putchar('\n'); // added new line for enter key diff --git a/demos/host/src/main.c b/demos/host/src/main.c index 7ebb389b..e3023bf6 100644 --- a/demos/host/src/main.c +++ b/demos/host/src/main.c @@ -109,7 +109,6 @@ void os_none_start_scheduler(void) msc_app_task(NULL); cdc_serial_app_task(NULL); rndis_app_task(NULL); - } } #endif @@ -144,8 +143,6 @@ int main(void) #error need to start RTOS schduler #endif - while(1) { } // should not be reached here - return 0; } diff --git a/demos/host/src/mouse_app.c b/demos/host/src/mouse_app.c index 4fabd4f3..6fdba459 100644 --- a/demos/host/src/mouse_app.c +++ b/demos/host/src/mouse_app.c @@ -122,6 +122,8 @@ OSAL_TASK_FUNCTION( mouse_app_task ) (void* p_task_para) OSAL_TASK_LOOP_BEGIN osal_queue_receive(queue_mouse_hdl, &mouse_report, OSAL_TIMEOUT_WAIT_FOREVER, &error); + (void) error; // supporess compiler's warninig + process_mouse_report(&mouse_report); OSAL_TASK_LOOP_END @@ -162,7 +164,7 @@ void cursor_movement(int8_t x, int8_t y, int8_t wheel) static inline void process_mouse_report(hid_mouse_report_t const * p_report) { - static hid_mouse_report_t prev_report = { 0 }; + static hid_mouse_report_t prev_report = { 0, 0, 0, 0 }; //------------- button state -------------// uint8_t button_changed_mask = p_report->buttons ^ prev_report.buttons; diff --git a/demos/host/src/tusb_config.h b/demos/host/src/tusb_config.h index 13362054..30fc5eae 100644 --- a/demos/host/src/tusb_config.h +++ b/demos/host/src/tusb_config.h @@ -68,7 +68,7 @@ #define TUSB_CFG_HOST_HID_KEYBOARD 1 #define TUSB_CFG_HOST_HID_MOUSE 1 #define TUSB_CFG_HOST_HID_GENERIC 0 -#define TUSB_CFG_HOST_MSC 0 +#define TUSB_CFG_HOST_MSC 1 #define TUSB_CFG_HOST_CDC 1 #define TUSB_CFG_HOST_CDC_RNDIS 0 diff --git a/tinyusb/class/msc_host.c b/tinyusb/class/msc_host.c index 1380b1e0..e81bed25 100644 --- a/tinyusb/class/msc_host.c +++ b/tinyusb/class/msc_host.c @@ -377,7 +377,7 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con SUBTASK_ASSERT_STATUS(error); //------------- SCSI Request Sense -------------// - tusbh_msc_request_sense(dev_addr, 0, msch_buffer); + (void) tusbh_msc_request_sense(dev_addr, 0, msch_buffer); osal_semaphore_wait(msch_sem_hdl, SCSI_XFER_TIMEOUT, &error); SUBTASK_ASSERT_STATUS(error); diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index 9d606e18..c20112d7 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -123,7 +123,7 @@ static ehci_link_t* list_find_previous_item(ehci_link_t* p_head, ehci_link_t* p static tusb_error_t list_remove_qhd(ehci_link_t* p_head, ehci_link_t* p_remove); static tusb_error_t hcd_controller_init(uint8_t hostid) ATTR_WARN_UNUSED_RESULT; -static tusb_error_t hcd_controller_stop(uint8_t hostid) ATTR_WARN_UNUSED_RESULT; +static tusb_error_t hcd_controller_stop(uint8_t hostid) ATTR_WARN_UNUSED_RESULT ATTR_UNUSED; //--------------------------------------------------------------------+ // USBH-HCD API @@ -278,20 +278,6 @@ static tusb_error_t hcd_controller_stop(uint8_t hostid) return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; } -//tusb_error_t hcd_controller_reset(uint8_t hostid) -//{ -// ehci_registers_t* const regs = get_operational_register(hostid); -// timeout_timer_t timeout; -// -//// NXP chip powered with non-host mode --> sts bit is not correctly reflected -// regs->usb_cmd_bit.reset = 1; -// -// timeout_set(&timeout, 2); // should not take longer the time to stop controller -// while( regs->usb_cmd_bit.reset && !timeout_expired(&timeout)) {} -// -// return timeout_expired(&timeout) ? TUSB_ERROR_OSAL_TIMEOUT : TUSB_ERROR_NONE; -//} - //--------------------------------------------------------------------+ // CONTROL PIPE API //--------------------------------------------------------------------+ diff --git a/tinyusb/host/hub.h b/tinyusb/host/hub.h index b6cdd599..956dee50 100644 --- a/tinyusb/host/hub.h +++ b/tinyusb/host/hub.h @@ -200,7 +200,6 @@ tusb_error_t hub_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t cons void hub_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes); void hub_close(uint8_t dev_addr); -tusb_error_t hub_status_pipe_queue(uint8_t dev_addr); #endif #ifdef __cplusplus diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 300233f4..3cb869bd 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -36,12 +36,6 @@ */ /**************************************************************************/ -/** \file - * \brief TBD - * - * \note TBD - */ - /** \ingroup TBD * \defgroup TBD * \brief TBD