diff options
| author | hathach <[email protected]> | 2013-01-16 12:43:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-01-16 12:43:17 +0700 |
| commit | c004cd438724063007eec0f43a4681e84a839252 (patch) | |
| tree | 0aebcc179e05d3b4a071d85fdf282d3f7a782642 /tinyusb | |
| parent | 54a766817783f41f5046b989ce33194cbb7e6529 (diff) | |
add uart for lpc11uxx and retarget successfully
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/common/fifo.c | 6 | ||||
| -rw-r--r-- | tinyusb/common/fifo.h | 3 | ||||
| -rw-r--r-- | tinyusb/common/mcu/mcu.h | 8 |
3 files changed, 10 insertions, 7 deletions
diff --git a/tinyusb/common/fifo.c b/tinyusb/common/fifo.c index 71e9af4e1..756de638e 100644 --- a/tinyusb/common/fifo.c +++ b/tinyusb/common/fifo.c @@ -84,13 +84,17 @@ static inline void mutex_unlock (fifo_t* f) Set the -1 if not required. */ /**************************************************************************/ -void fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq) +bool fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq) { + ASSERT(size > 0, false); + f->buf = buffer; f->size = size; f->rd_ptr = f->wr_ptr = f->len = 0; f->overwritable = overwritable; f->irq = irq; + + return true; } /**************************************************************************/ diff --git a/tinyusb/common/fifo.h b/tinyusb/common/fifo.h index 7f8312e1f..ea50bc563 100644 --- a/tinyusb/common/fifo.h +++ b/tinyusb/common/fifo.h @@ -69,8 +69,7 @@ typedef struct _fifo_t IRQn_Type irq ; ///< interrupt used to lock fifo } fifo_t; - -void fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq); +bool fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq); bool fifo_write(fifo_t* f, uint8_t data); bool fifo_read(fifo_t* f, uint8_t *data); uint16_t fifo_readArray(fifo_t* f, uint8_t * rx, uint16_t maxlen); diff --git a/tinyusb/common/mcu/mcu.h b/tinyusb/common/mcu/mcu.h index 361f453a0..14adb0b61 100644 --- a/tinyusb/common/mcu/mcu.h +++ b/tinyusb/common/mcu/mcu.h @@ -51,13 +51,13 @@ #ifndef _TUSB_MCU_H_ #define _TUSB_MCU_H_ -#define MCU_LPC13UXX 1 -#define MCU_LPC11UXX 2 -#define MCU_LPC43XX 3 - #define ENDIAN_LITTLE ///< MCU Endian #define ALIGNMENT (4) ///< MCU Alignment +#define MCU_LPC13UXX 0 +#define MCU_LPC11UXX 1 +#define MCU_LPC43XX 2 + #if MCU == MCU_LPC13UXX #include "mcu_lpc13uxx.h" #elif MCU == MCU_LPC43XX |
