diff options
| author | hathach <[email protected]> | 2013-01-26 01:37:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-01-26 01:37:15 +0700 |
| commit | 7edda37518f0b193009c832b4092c357d0d01e96 (patch) | |
| tree | c6952e1f97b6c89e37968364c5c0a2a88958b3bf /tinyusb/osal | |
| parent | fdc9a82e8c3dcce08613f0c0e1a773f0c39381e0 (diff) | |
add more test code for keyboard hid application API
refractor, restructure, rename several thing regarding host, keyboard etc ...
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal.h | 1 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 07a65f5b2..2e3c2a2cf 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -81,6 +81,7 @@ enum //--------------------------------------------------------------------+ typedef uint32_t osal_queue_id_t; +tusb_error_t osal_queue_create(osal_queue_id_t qid, uint8_t *buffer); tusb_error_t osal_queue_put(osal_queue_id_t qid, uint32_t data, osal_timeout_t msec); tusb_error_t osal_queue_get(osal_queue_id_t qid, uint32_t *data, osal_timeout_t msec); diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index d14277f39..198e5dc2c 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -60,6 +60,17 @@ //--------------------------------------------------------------------+ // QUEUE API //--------------------------------------------------------------------+ +typedef struct{ + uint8_t *buf ; ///< buffer pointer + uint16_t size ; ///< buffer size + volatile uint16_t len ; ///< bytes in fifo + volatile uint16_t wr_ptr ; ///< write pointer + volatile uint16_t rd_ptr ; ///< read pointer +} osal_queue_t; + +#define OSAL_DEF_QUEUE(name, size)\ + osal_queue_t name;\ + uint8_t buffer_##name[size] #ifdef __cplusplus } |
