tested with IAR & keil for device ea4357, fix some warnings

This commit is contained in:
hathach 2014-03-23 17:33:58 +07:00
parent 5d5aa9b213
commit a8d32d81b3
3 changed files with 57 additions and 53 deletions

View File

@ -59,7 +59,7 @@
//------------- CLASS -------------//
#define TUSB_CFG_DEVICE_HID_KEYBOARD 1
#define TUSB_CFG_DEVICE_HID_MOUSE 0
#define TUSB_CFG_DEVICE_HID_MOUSE 1
#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
#define TUSB_CFG_DEVICE_MSC 1
#define TUSB_CFG_DEVICE_CDC 1

View File

@ -286,11 +286,13 @@ tusb_error_t dcd_init(void)
//--------------------------------------------------------------------+
// PIPE HELPER
//--------------------------------------------------------------------+
#if 0
static inline uint8_t edpt_pos2phy(uint8_t pos) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t edpt_pos2phy(uint8_t pos)
{ // 0-5 --> OUT, 16-21 IN
return (pos < DCD_QHD_MAX/2) ? (2*pos) : (2*(pos-16)+1);
}
#endif
static inline uint8_t edpt_phy2pos(uint8_t physical_endpoint) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint8_t edpt_phy2pos(uint8_t physical_endpoint)
@ -546,7 +548,8 @@ void dcd_isr(uint8_t coreid)
{
LPC_USB0_Type* const lpc_usb = LPC_USB[coreid];
uint32_t const int_status = lpc_usb->USBSTS_D & lpc_usb->USBINTR_D;
uint32_t const int_enable = lpc_usb->USBINTR_D;
uint32_t const int_status = lpc_usb->USBSTS_D & int_enable;
lpc_usb->USBSTS_D = int_status; // Acknowledge handled interrupt
if (int_status == 0) return;// disabled interrupt sources

View File

@ -297,7 +297,8 @@ void dcd_isr(uint8_t coreid)
{
(void) coreid;
uint32_t const int_status = LPC_USB->INTSTAT & LPC_USB->INTEN;
uint32_t const int_enable = LPC_USB->INTEN;
uint32_t const int_status = LPC_USB->INTSTAT & int_enable;
LPC_USB->INTSTAT = int_status; // Acknowledge handled interrupt
if (int_status == 0) return;