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/host | |
| parent | 30124b9b02e067c967aca642823f3ed4cb7f618d (diff) | |
clean up osal semaphore/queue/mutex
Diffstat (limited to 'tinyusb/host')
| -rw-r--r-- | tinyusb/host/usbh.c | 8 | ||||
| -rw-r--r-- | tinyusb/host/usbh.h | 2 | ||||
| -rw-r--r-- | tinyusb/host/usbh_hcd.h | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index 8d19f5f15..3e242d82b 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -42,6 +42,10 @@ #define _TINY_USB_SOURCE_FILE_
+#ifndef TUSB_CFG_OS_TASK_PRIO
+#define TUSB_CFG_OS_TASK_PRIO 0
+#endif
+
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
@@ -153,10 +157,10 @@ tusb_error_t usbh_init(void) {
usbh_device_info_t * const p_device = &usbh_devices[i];
- p_device->control.sem_hdl = osal_semaphore_create( OSAL_SEM_REF(p_device->control.semaphore) );
+ p_device->control.sem_hdl = osal_semaphore_create(1, 0);
ASSERT_PTR(p_device->control.sem_hdl, TUSB_ERROR_OSAL_SEMAPHORE_FAILED);
- p_device->control.mutex_hdl = osal_mutex_create ( OSAL_MUTEX_REF(p_device->control.mutex) );
+ p_device->control.mutex_hdl = osal_mutex_create();
ASSERT_PTR(p_device->control.mutex_hdl, TUSB_ERROR_OSAL_MUTEX_FAILED);
}
diff --git a/tinyusb/host/usbh.h b/tinyusb/host/usbh.h index 33e4e5a50..d7610888e 100644 --- a/tinyusb/host/usbh.h +++ b/tinyusb/host/usbh.h @@ -98,7 +98,7 @@ ATTR_WEAK void tuh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor #ifdef _TINY_USB_SOURCE_FILE_ -OSAL_TASK_FUNCTION (usbh_enumeration_task, p_task_para); +void usbh_enumeration_task(void* param); tusb_error_t usbh_init(void); tusb_error_t usbh_control_xfer_subtask(uint8_t dev_addr, uint8_t bmRequestType, uint8_t bRequest, diff --git a/tinyusb/host/usbh_hcd.h b/tinyusb/host/usbh_hcd.h index 7e03e8764..0f96d4ddc 100644 --- a/tinyusb/host/usbh_hcd.h +++ b/tinyusb/host/usbh_hcd.h @@ -91,11 +91,8 @@ typedef struct { // uint8_t xferred_bytes; TODO not yet necessary tusb_control_request_t request; - OSAL_SEM_DEF(semaphore); // TODO move to semaphore pool ? - osal_semaphore_handle_t sem_hdl; // used to synchronize with HCD when control xfer complete - - OSAL_MUTEX_DEF(mutex); // TODO move to mutex pool ? - osal_mutex_handle_t mutex_hdl; // used to exclusively occupy control pipe + osal_semaphore_t sem_hdl; // used to synchronize with HCD when control xfer complete + osal_mutex_t mutex_hdl; // used to exclusively occupy control pipe } control; } usbh_device_info_t; |
