diff options
| author | hathach <[email protected]> | 2013-10-02 14:20:05 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-10-02 14:20:05 +0700 |
| commit | 6f9172c15f1c2447549f3004f849261aa580d4f9 (patch) | |
| tree | 1565fa8c0f570ec02e541805aa5e0cf0fa8eaf7e /tinyusb/hal | |
| parent | 1263dbb1221fc550737e560c415857829e8ecfd1 (diff) | |
clean up warnings here and there
Diffstat (limited to 'tinyusb/hal')
| -rw-r--r-- | tinyusb/hal/hal.h | 34 | ||||
| -rw-r--r-- | tinyusb/hal/hal_lpc175x_6x.h | 4 |
2 files changed, 24 insertions, 14 deletions
diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h index 6817baf3a..b0de23422 100644 --- a/tinyusb/hal/hal.h +++ b/tinyusb/hal/hal.h @@ -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 diff --git a/tinyusb/hal/hal_lpc175x_6x.h b/tinyusb/hal/hal_lpc175x_6x.h index 3b94b23c3..4f3224cee 100644 --- a/tinyusb/hal/hal_lpc175x_6x.h +++ b/tinyusb/hal/hal_lpc175x_6x.h @@ -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" - //--------------------------------------------------------------------+ // //--------------------------------------------------------------------+ |
