diff options
| author | hathach <[email protected]> | 2018-03-01 11:17:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-01 11:17:11 +0700 |
| commit | a789fad4b7b23b8324e07ee4b9d08a145f5df0f9 (patch) | |
| tree | 4591738b231d2229b863b7a61b9bb5bb1c69733c /tinyusb/device | |
| parent | 30124b9b02e067c967aca642823f3ed4cb7f618d (diff) | |
clean up osal semaphore/queue/mutex
Diffstat (limited to 'tinyusb/device')
| -rw-r--r-- | tinyusb/device/usbd.c | 5 | ||||
| -rw-r--r-- | tinyusb/device/usbd.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index c4552c3fc..790143320 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -147,10 +147,9 @@ STATIC_ASSERT(sizeof(usbd_task_event_t) <= 12, "size is not correct"); #define TUSB_CFG_OS_TASK_PRIO 0
#endif
-OSAL_SEM_DEF(usbd_control_xfer_semaphore_def);
static osal_queue_t usbd_queue_hdl;
-/*static*/ osal_semaphore_handle_t usbd_control_xfer_sem_hdl; // TODO may need to change to static with wrapper function
+/*static*/ osal_semaphore_t usbd_control_xfer_sem_hdl; // TODO may need to change to static with wrapper function
//--------------------------------------------------------------------+
// IMPLEMENTATION
@@ -166,7 +165,7 @@ tusb_error_t usbd_init (void) usbd_queue_hdl = osal_queue_create(USBD_TASK_QUEUE_DEPTH, sizeof(usbd_task_event_t));
ASSERT_PTR(usbd_queue_hdl, TUSB_ERROR_OSAL_QUEUE_FAILED);
- usbd_control_xfer_sem_hdl = osal_semaphore_create( OSAL_SEM_REF(usbd_control_xfer_semaphore_def) );
+ usbd_control_xfer_sem_hdl = osal_semaphore_create(1, 0);
ASSERT_PTR(usbd_queue_hdl, TUSB_ERROR_OSAL_SEMAPHORE_FAILED);
osal_task_t usbd_hdl;
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h index c2c5c702b..1c7f1b79a 100644 --- a/tinyusb/device/usbd.h +++ b/tinyusb/device/usbd.h @@ -99,7 +99,7 @@ bool tusbd_is_configured(uint8_t coreid) ATTR_WARN_UNUSED_RESULT; //--------------------------------------------------------------------+
#ifdef _TINY_USB_SOURCE_FILE_
-extern osal_semaphore_handle_t usbd_control_xfer_sem_hdl;
+extern osal_semaphore_t usbd_control_xfer_sem_hdl;
tusb_error_t usbd_init(void);
void usbd_task( void* param);
|
