clean up warnings here and there
This commit is contained in:
@@ -55,8 +55,8 @@
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CDC_PIPE_ERROR,
|
||||
CDC_PIPE_NOTIFICATION = 1,
|
||||
CDC_PIPE_ERROR = 0,
|
||||
CDC_PIPE_NOTIFICATION,
|
||||
CDC_PIPE_DATA_IN,
|
||||
CDC_PIPE_DATA_OUT
|
||||
}cdc_pipeid_t;
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \addtogroup Group_ClassDriver Class Driver
|
||||
* @{
|
||||
* \defgroup Group_HID Human Interface Device
|
||||
@@ -293,7 +293,7 @@ enum USB_HID_LOCAL_CODE
|
||||
#define HID_REPORT_DATA_3(data) , U32_TO_U8S_LE(data)
|
||||
|
||||
#define HID_REPORT_ITEM(data, tag, type, size) \
|
||||
((tag << 4) | (type << 2) | size) HID_REPORT_DATA_##size(data)
|
||||
(((tag) << 4) | ((type) << 2) | (size)) HID_REPORT_DATA_##size(data)
|
||||
|
||||
#define RI_TYPE_MAIN 0
|
||||
#define RI_TYPE_GLOBAL 1
|
||||
|
||||
@@ -401,8 +401,6 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
|
||||
tusbh_msc_mounted_cb(dev_addr);
|
||||
|
||||
OSAL_SUBTASK_END
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
void msch_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
|
||||
|
||||
+10
-10
@@ -99,17 +99,17 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// INLINE FUNCTION
|
||||
//--------------------------------------------------------------------+
|
||||
#define memclr_(buffer, size) memset(buffer, 0, size)
|
||||
#define memclr_(buffer, size) memset((buffer), 0, (size))
|
||||
|
||||
|
||||
static inline uint8_t const * descriptor_next(uint8_t const * p_desc) ATTR_ALWAYS_INLINE ATTR_PURE;
|
||||
static inline uint8_t const * descriptor_next(uint8_t const * p_desc)
|
||||
static inline uint8_t const * descriptor_next(uint8_t const p_desc[]) ATTR_ALWAYS_INLINE ATTR_PURE;
|
||||
static inline uint8_t const * descriptor_next(uint8_t const p_desc[])
|
||||
{
|
||||
return p_desc + p_desc[DESCRIPTOR_OFFSET_LENGTH];
|
||||
}
|
||||
|
||||
static inline uint8_t descriptor_typeof(uint8_t const * p_desc) ATTR_ALWAYS_INLINE ATTR_PURE;
|
||||
static inline uint8_t descriptor_typeof(uint8_t const * p_desc)
|
||||
static inline uint8_t descriptor_typeof(uint8_t const p_desc[]) ATTR_ALWAYS_INLINE ATTR_PURE;
|
||||
static inline uint8_t descriptor_typeof(uint8_t const p_desc[])
|
||||
{
|
||||
return p_desc[DESCRIPTOR_OFFSET_TYPE];
|
||||
}
|
||||
@@ -119,13 +119,13 @@ static inline uint8_t descriptor_typeof(uint8_t const * p_desc)
|
||||
static inline uint32_t u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4) ATTR_ALWAYS_INLINE ATTR_CONST;
|
||||
static inline uint32_t u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4)
|
||||
{
|
||||
return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;
|
||||
return ( ((uint32_t) b1) << 24) + ( ((uint32_t) b2) << 16) + ( ((uint32_t) b3) << 8) + b4;
|
||||
}
|
||||
|
||||
static inline uint8_t u16_high_u8(uint16_t u16) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t u16_high_u8(uint16_t u16)
|
||||
{
|
||||
return (uint8_t) ((u16 >> 8) & 0x00ff);
|
||||
return (uint8_t) ( ((uint16_t) (u16 >> 8)) & 0x00ff);
|
||||
}
|
||||
|
||||
static inline uint8_t u16_low_u8(uint16_t u16) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
@@ -137,7 +137,7 @@ static inline uint8_t u16_low_u8(uint16_t u16)
|
||||
static inline uint16_t u16_le2be(uint16_t u16) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
static inline uint16_t u16_le2be(uint16_t u16)
|
||||
{
|
||||
return (u16_low_u8(u16) << 8) | u16_high_u8(u16);
|
||||
return ((uint16_t)(u16_low_u8(u16) << 8)) | u16_high_u8(u16);
|
||||
}
|
||||
|
||||
//------------- Min -------------//
|
||||
@@ -182,7 +182,7 @@ static inline uint32_t align16 (uint32_t value)
|
||||
static inline uint32_t align_n (uint32_t alignment, uint32_t value) ATTR_ALWAYS_INLINE ATTR_CONST;
|
||||
static inline uint32_t align_n (uint32_t alignment, uint32_t value)
|
||||
{
|
||||
return value & (~(alignment-1));
|
||||
return value & ((uint32_t) ~(alignment-1));
|
||||
}
|
||||
|
||||
static inline uint32_t align4k (uint32_t value) ATTR_ALWAYS_INLINE ATTR_CONST;
|
||||
@@ -212,7 +212,7 @@ static inline bool is_in_range_exclusive(uint32_t lower, uint32_t value, uint32_
|
||||
return (lower < value) && (value < upper);
|
||||
}
|
||||
|
||||
|
||||
// TODO use clz
|
||||
static inline uint8_t log2_of(uint32_t value) ATTR_ALWAYS_INLINE ATTR_CONST;
|
||||
static inline uint8_t log2_of(uint32_t value)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#if TUSB_CFG_DEBUG == 3
|
||||
|
||||
char const* const TUSB_ErrorStr[] =
|
||||
char const* const TUSB_ErrorStr[TUSB_ERROR_COUNT] =
|
||||
{
|
||||
ERROR_TABLE(ERROR_STRING)
|
||||
0
|
||||
|
||||
@@ -104,7 +104,7 @@ typedef enum {
|
||||
|
||||
#if TUSB_CFG_DEBUG == 3
|
||||
/// Enum to String for debugging purposes. Only available if \ref TUSB_CFG_DEBUG > 0
|
||||
extern char const* const TUSB_ErrorStr[];
|
||||
extern char const* const TUSB_ErrorStr[TUSB_ERROR_COUNT];
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -78,7 +78,7 @@ typedef ATTR_PACKED_STRUCT(struct){
|
||||
static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient)
|
||||
{
|
||||
return (direction << 7) | (type << 5) | recipient;
|
||||
return ((uint8_t) (direction << 7)) | ((uint8_t) (type << 5)) | (recipient);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+22
-12
@@ -42,7 +42,7 @@
|
||||
* \note TBD
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* \defgroup Group_HAL Hardware Abtract Layer
|
||||
* \brief Hardware dependent layer
|
||||
*
|
||||
@@ -52,11 +52,31 @@
|
||||
#ifndef _TUSB_HAL_H_
|
||||
#define _TUSB_HAL_H_
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDES
|
||||
//--------------------------------------------------------------------+
|
||||
#include "tusb_option.h"
|
||||
#include "common/primitive_types.h"
|
||||
#include "common/errors.h"
|
||||
#include "common/compiler/compiler.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// HAL API
|
||||
//--------------------------------------------------------------------+
|
||||
// callback from tusb.h
|
||||
extern void tusb_isr(uint8_t controller_id);
|
||||
|
||||
/// USB hardware init
|
||||
tusb_error_t hal_init(void);
|
||||
|
||||
/// Enable USB Interrupt
|
||||
static inline void hal_interrupt_enable(uint8_t controller_id) ATTR_ALWAYS_INLINE;
|
||||
/// Disable USB Interrupt
|
||||
static inline void hal_interrupt_disable(uint8_t controller_id) ATTR_ALWAYS_INLINE;
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE DRIVEN
|
||||
//--------------------------------------------------------------------+
|
||||
#if MCU == 0
|
||||
#error MCU is not defined or supported yet
|
||||
#elif MCU == MCU_LPC11UXX
|
||||
@@ -75,22 +95,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// callback from tusb.h
|
||||
extern void tusb_isr(uint8_t controller_id);
|
||||
|
||||
/// USB hardware init
|
||||
tusb_error_t hal_init(void);
|
||||
|
||||
/// Enable USB Interrupt
|
||||
static inline void hal_interrupt_enable(uint8_t controller_id) ATTR_ALWAYS_INLINE;
|
||||
/// Disable USB Interrupt
|
||||
static inline void hal_interrupt_disable(uint8_t controller_id) ATTR_ALWAYS_INLINE;
|
||||
|
||||
static inline bool hal_debugger_is_attached(void) ATTR_PURE ATTR_ALWAYS_INLINE;
|
||||
static inline bool hal_debugger_is_attached(void)
|
||||
{
|
||||
#if !defined(_TEST_) && !(MCU==MCU_LPC11UXX)
|
||||
return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == CoreDebug_DHCSR_C_DEBUGEN_Msk;
|
||||
return ( (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == CoreDebug_DHCSR_C_DEBUGEN_Msk );
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -46,12 +46,12 @@
|
||||
#ifndef _TUSB_HAL_LPC175X_6X_H_
|
||||
#define _TUSB_HAL_LPC175X_6X_H_
|
||||
|
||||
#include "LPC17xx.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "LPC17xx.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
//
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
@@ -833,9 +833,9 @@ STATIC_ INLINE_ ehci_link_t* get_period_frame_list(uint8_t hostid)
|
||||
case 1:
|
||||
return period_frame_list1;
|
||||
#endif
|
||||
|
||||
default: return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,10 +50,6 @@
|
||||
#ifndef _TUSB_TUSB_OPTION_H_
|
||||
#define _TUSB_TUSB_OPTION_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define TUSB_VERSION_YEAR 00
|
||||
#define TUSB_VERSION_MONTH 00
|
||||
#define TUSB_VERSION_WEEK 0
|
||||
@@ -191,12 +187,6 @@
|
||||
#define CDC_NOTIFICATION_EP_MAXPACKETSIZE 8
|
||||
#define CDC_DATA_EP_MAXPACKET_SIZE 16
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TUSB_TUSB_OPTION_H_ */
|
||||
|
||||
/** @} */
|
||||
|
||||
Reference in New Issue
Block a user