summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-13 18:11:59 +0700
committerhathach <[email protected]>2014-03-13 18:11:59 +0700
commitf1692c93ac7f9990490223cf924d84e1cbdcbeb6 (patch)
treec125767ad7d26476707049784ff17324ef4f9ece
parent8fbafc460cceb6943179c0b0613d619bb9511b3c (diff)
fix some warnings
-rw-r--r--boards/embedded_artists/ea4357/board_ea4357.c2
-rw-r--r--demos/host/src/cdc_serial_app.c7
-rw-r--r--demos/host/src/cli.c2
-rw-r--r--demos/host/src/keyboard_app.c15
-rw-r--r--demos/host/src/main.c3
-rw-r--r--demos/host/src/mouse_app.c4
-rw-r--r--demos/host/src/tusb_config.h2
-rw-r--r--tinyusb/class/msc_host.c2
-rw-r--r--tinyusb/host/ehci/ehci.c16
-rw-r--r--tinyusb/host/hub.h1
-rw-r--r--tinyusb/osal/osal_none.h6
11 files changed, 17 insertions, 43 deletions
diff --git a/boards/embedded_artists/ea4357/board_ea4357.c b/boards/embedded_artists/ea4357/board_ea4357.c
index d0ac98beb..ce38a6921 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 208cb28a6..6c9e2359e 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 6abf1467d..b3bdb3967 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 07e65ce7b..a6631a760 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 7ebb389bc..e3023bf60 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 4fabd4f36..6fdba4591 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 13362054c..30fc5eae2 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 1380b1e03..e81bed258 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 9d606e183..c20112d73 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 b6cdd599f..956dee505 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 300233f42..3cb869bd1 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