mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
clean more warnings
This commit is contained in:
parent
5e2ed2534e
commit
5f309413dc
@ -151,6 +151,8 @@ int main(void)
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
OSAL_TASK_FUNCTION( led_blinking_task ) (void* p_task_para)
|
OSAL_TASK_FUNCTION( led_blinking_task ) (void* p_task_para)
|
||||||
{
|
{
|
||||||
|
(void) p_task_para; // suppress compiler warnings
|
||||||
|
|
||||||
static uint32_t led_on_mask = 0;
|
static uint32_t led_on_mask = 0;
|
||||||
|
|
||||||
OSAL_TASK_LOOP_BEGIN
|
OSAL_TASK_LOOP_BEGIN
|
||||||
|
@ -184,6 +184,8 @@ tusb_error_t tusbh_msc_read_capacity10(uint8_t dev_addr, uint8_t lun, uint8_t *p
|
|||||||
|
|
||||||
tusb_error_t tusbh_msc_request_sense(uint8_t dev_addr, uint8_t lun, uint8_t *p_data)
|
tusb_error_t tusbh_msc_request_sense(uint8_t dev_addr, uint8_t lun, uint8_t *p_data)
|
||||||
{
|
{
|
||||||
|
(void) lun; // TODO [MSCH] multiple lun support
|
||||||
|
|
||||||
msch_interface_t* p_msch = &msch_data[dev_addr-1];
|
msch_interface_t* p_msch = &msch_data[dev_addr-1];
|
||||||
|
|
||||||
//------------- Command Block Wrapper -------------//
|
//------------- Command Block Wrapper -------------//
|
||||||
|
@ -38,8 +38,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "fifo.h"
|
#include "fifo.h"
|
||||||
|
|
||||||
static inline void mutex_lock (fifo_t* f) ATTR_ALWAYS_INLINE;
|
//static inline void mutex_lock (fifo_t* f) ATTR_ALWAYS_INLINE;
|
||||||
static inline void mutex_unlock (fifo_t* f) ATTR_ALWAYS_INLINE;
|
//static inline void mutex_unlock (fifo_t* f) ATTR_ALWAYS_INLINE;
|
||||||
|
#define mutex_lock(f)
|
||||||
|
#define mutex_unlock(f)
|
||||||
|
|
||||||
static inline bool is_fifo_initalized(fifo_t* f) ATTR_ALWAYS_INLINE;
|
static inline bool is_fifo_initalized(fifo_t* f) ATTR_ALWAYS_INLINE;
|
||||||
|
|
||||||
|
|
||||||
@ -154,15 +157,15 @@ void fifo_clear(fifo_t *f)
|
|||||||
Pointer to the FIFO that should be protected
|
Pointer to the FIFO that should be protected
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
static inline void mutex_lock (fifo_t* f)
|
//static inline void mutex_lock (fifo_t* f)
|
||||||
{
|
//{
|
||||||
// if (f->irq > 0)
|
// if (f->irq > 0)
|
||||||
// {
|
// {
|
||||||
// #if !defined (_TEST_)
|
// #if !defined (_TEST_)
|
||||||
// NVIC_DisableIRQ(f->irq);
|
// NVIC_DisableIRQ(f->irq);
|
||||||
// #endif
|
// #endif
|
||||||
// }
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
@ -172,15 +175,15 @@ static inline void mutex_lock (fifo_t* f)
|
|||||||
Pointer to the FIFO that should be protected
|
Pointer to the FIFO that should be protected
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
static inline void mutex_unlock (fifo_t* f)
|
//static inline void mutex_unlock (fifo_t* f)
|
||||||
{
|
//{
|
||||||
// if (f->irq > 0)
|
// if (f->irq > 0)
|
||||||
// {
|
// {
|
||||||
// #if !defined (_TEST_)
|
// #if !defined (_TEST_)
|
||||||
// NVIC_EnableIRQ(f->irq);
|
// NVIC_EnableIRQ(f->irq);
|
||||||
// #endif
|
// #endif
|
||||||
// }
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
static inline bool is_fifo_initalized(fifo_t* f)
|
static inline bool is_fifo_initalized(fifo_t* f)
|
||||||
{
|
{
|
||||||
|
@ -207,10 +207,15 @@ tusb_error_t hub_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t cons
|
|||||||
OSAL_SUBTASK_END
|
OSAL_SUBTASK_END
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// is the response of interrupt endpoint polling
|
||||||
void hub_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
void hub_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||||
{
|
{
|
||||||
|
(void) xferred_bytes; // TODO can be more than 1 for hub with lots of ports
|
||||||
|
|
||||||
usbh_hub_t * p_hub = &hub_data[pipe_hdl.dev_addr-1];
|
usbh_hub_t * p_hub = &hub_data[pipe_hdl.dev_addr-1];
|
||||||
|
|
||||||
|
if ( event == TUSB_EVENT_XFER_COMPLETE )
|
||||||
|
{
|
||||||
for (uint8_t port=1; port <= p_hub->port_number; port++)
|
for (uint8_t port=1; port <= p_hub->port_number; port++)
|
||||||
{ // TODO HUB ignore bit0 hub_status_change
|
{ // TODO HUB ignore bit0 hub_status_change
|
||||||
if ( BIT_TEST_(p_hub->status_change, port) )
|
if ( BIT_TEST_(p_hub->status_change, port) )
|
||||||
@ -218,9 +223,14 @@ void hub_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
|||||||
usbh_hub_port_plugged_isr(pipe_hdl.dev_addr, port);
|
usbh_hub_port_plugged_isr(pipe_hdl.dev_addr, port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: next status transfer is queued by usbh.c after handling this request
|
// NOTE: next status transfer is queued by usbh.c after handling this request
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO [HUB] check if hub is still plugged before polling status endpoint since failed usually mean hub unplugged
|
||||||
|
// ASSERT_INT ( TUSB_ERROR_NONE, hcd_pipe_xfer(pipe_hdl, &p_hub->status_change, 1, true) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void hub_close(uint8_t dev_addr)
|
void hub_close(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
|
@ -240,10 +240,11 @@ static inline tusb_error_t usbh_pipe_control_close(uint8_t dev_addr)
|
|||||||
return TUSB_ERROR_NONE;
|
return TUSB_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tusb_interface_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
|
// TODO [USBH] unify pipe status get
|
||||||
{
|
//tusb_interface_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
|
||||||
return TUSB_INTERFACE_STATUS_BUSY;
|
//{
|
||||||
}
|
// return TUSB_INTERFACE_STATUS_BUSY;
|
||||||
|
//}
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// USBH-HCD ISR/Callback API
|
// USBH-HCD ISR/Callback API
|
||||||
@ -347,6 +348,8 @@ static tusb_error_t enumeration_body_subtask(void);
|
|||||||
// forever loop cannot have any return at all.
|
// forever loop cannot have any return at all.
|
||||||
OSAL_TASK_FUNCTION(usbh_enumeration_task) (void* p_task_para)
|
OSAL_TASK_FUNCTION(usbh_enumeration_task) (void* p_task_para)
|
||||||
{
|
{
|
||||||
|
(void) p_task_para; // suppress compiler warnings
|
||||||
|
|
||||||
OSAL_TASK_LOOP_BEGIN
|
OSAL_TASK_LOOP_BEGIN
|
||||||
|
|
||||||
enumeration_body_subtask();
|
enumeration_body_subtask();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user