diff options
| author | hathach <[email protected]> | 2013-04-07 03:40:24 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-04-07 03:40:24 +0700 |
| commit | 1776bb53f630295c33ea0d283deadf8a794b8c88 (patch) | |
| tree | 39f553f70c1e24fa8a6cca6fb040de336fad4954 /tinyusb/osal | |
| parent | b5f7e48ad4767f6d3b79e920c5ca8ff33b0dfca4 (diff) | |
add hal init for USB1 and trying to get USB1 working
add hack delay 100 ms after a port reset (huge) for correct speed detection
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal.h | 15 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 3208301a1..0ae4907db 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -141,8 +141,8 @@ tusb_error_t osal_task_create(osal_task_t *task); //--------------------------------------------------------------------+ // Semaphore API //--------------------------------------------------------------------+ -typedef volatile uint32_t osal_semaphore_t; -typedef void* osal_semaphore_handle_t; +typedef volatile uint8_t osal_semaphore_t; +typedef osal_semaphore_t * osal_semaphore_handle_t; #define OSAL_SEM_DEF(name)\ osal_semaphore_t name @@ -158,8 +158,15 @@ void osal_semaphore_reset(osal_semaphore_handle_t const sem_hdl); //--------------------------------------------------------------------+ // QUEUE API //--------------------------------------------------------------------+ -typedef uint32_t osal_queue_t; -typedef void* osal_queue_handle_t; +typedef struct{ + uint32_t * const buffer ; ///< buffer pointer + uint8_t const depth ; ///< buffer size + volatile uint8_t count ; ///< bytes in fifo + volatile uint8_t wr_idx ; ///< write pointer + volatile uint8_t rd_idx ; ///< read pointer +} osal_queue_t; + +typedef osal_queue_t * osal_queue_handle_t; #define OSAL_QUEUE_DEF(name, queue_depth, type) \ osal_queue_t name diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 4fe78311d..41a3801e9 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -67,8 +67,8 @@ static inline void osal_tick_tock(void) osal_tick_current++; } -static inline uint32_t osal_tick_get(void) ATTR_ALWAYS_INLINE; -static inline uint32_t osal_tick_get(void) +static inline volatile uint32_t osal_tick_get(void) ATTR_ALWAYS_INLINE; +static inline volatile uint32_t osal_tick_get(void) { return osal_tick_current; } |
