mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-22 01:21:20 +00:00
Name queues for easier FreeRTOS debugging with task- and queue-aware debuggers
This commit is contained in:
parent
cca4be6c67
commit
11fba59319
@ -279,7 +279,7 @@ tu_static uint8_t _usbd_rhport = RHPORT_INVALID;
|
|||||||
|
|
||||||
// Event queue
|
// Event queue
|
||||||
// usbd_int_set() is used as mutex in OS NONE config
|
// usbd_int_set() is used as mutex in OS NONE config
|
||||||
OSAL_QUEUE_DEF(usbd_int_set, _usbd_qdef, CFG_TUD_TASK_QUEUE_SZ, dcd_event_t);
|
OSAL_QUEUE_DEF(usbd_int_set, usbd_events, CFG_TUD_TASK_QUEUE_SZ, dcd_event_t);
|
||||||
tu_static osal_queue_t _usbd_q;
|
tu_static osal_queue_t _usbd_q;
|
||||||
|
|
||||||
// Mutex for claiming endpoint
|
// Mutex for claiming endpoint
|
||||||
@ -410,7 +410,7 @@ bool tud_init (uint8_t rhport)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Init device queue & task
|
// Init device queue & task
|
||||||
_usbd_q = osal_queue_create(&_usbd_qdef);
|
_usbd_q = osal_queue_create(&usbd_events);
|
||||||
TU_ASSERT(_usbd_q);
|
TU_ASSERT(_usbd_q);
|
||||||
|
|
||||||
// Get application driver if available
|
// Get application driver if available
|
||||||
|
@ -219,7 +219,7 @@ static usbh_device_t _usbh_devices[TOTAL_DEVICES];
|
|||||||
|
|
||||||
// Event queue
|
// Event queue
|
||||||
// usbh_int_set is used as mutex in OS NONE config
|
// usbh_int_set is used as mutex in OS NONE config
|
||||||
OSAL_QUEUE_DEF(usbh_int_set, _usbh_qdef, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
|
OSAL_QUEUE_DEF(usbh_int_set, usbh_events, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
|
||||||
static osal_queue_t _usbh_q;
|
static osal_queue_t _usbh_q;
|
||||||
|
|
||||||
CFG_TUH_MEM_SECTION CFG_TUH_MEM_ALIGN
|
CFG_TUH_MEM_SECTION CFG_TUH_MEM_ALIGN
|
||||||
@ -330,7 +330,7 @@ bool tuh_init(uint8_t controller_id)
|
|||||||
TU_LOG_INT(USBH_DEBUG, sizeof(tu_edpt_stream_t));
|
TU_LOG_INT(USBH_DEBUG, sizeof(tu_edpt_stream_t));
|
||||||
|
|
||||||
// Event queue
|
// Event queue
|
||||||
_usbh_q = osal_queue_create( &_usbh_qdef );
|
_usbh_q = osal_queue_create( &usbh_events );
|
||||||
TU_ASSERT(_usbh_q != NULL);
|
TU_ASSERT(_usbh_q != NULL);
|
||||||
|
|
||||||
#if OSAL_MUTEX_REQUIRED
|
#if OSAL_MUTEX_REQUIRED
|
||||||
|
@ -56,7 +56,7 @@ typedef SemaphoreHandle_t osal_mutex_t;
|
|||||||
// _int_set is not used with an RTOS
|
// _int_set is not used with an RTOS
|
||||||
#define OSAL_QUEUE_DEF(_int_set, _name, _depth, _type) \
|
#define OSAL_QUEUE_DEF(_int_set, _name, _depth, _type) \
|
||||||
static _type _name##_##buf[_depth];\
|
static _type _name##_##buf[_depth];\
|
||||||
osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf };
|
osal_queue_def_t _name = { .depth = _depth, .item_sz = sizeof(_type), .buf = _name##_##buf, .pQueueName = #_name };
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -66,6 +66,7 @@ typedef struct
|
|||||||
#if configSUPPORT_STATIC_ALLOCATION
|
#if configSUPPORT_STATIC_ALLOCATION
|
||||||
StaticQueue_t sq;
|
StaticQueue_t sq;
|
||||||
#endif
|
#endif
|
||||||
|
const char* pQueueName;
|
||||||
}osal_queue_def_t;
|
}osal_queue_def_t;
|
||||||
|
|
||||||
typedef QueueHandle_t osal_queue_t;
|
typedef QueueHandle_t osal_queue_t;
|
||||||
@ -176,7 +177,7 @@ TU_ATTR_ALWAYS_INLINE static inline osal_queue_t osal_queue_create(osal_queue_de
|
|||||||
q = xQueueCreate(qdef->depth, qdef->item_sz);
|
q = xQueueCreate(qdef->depth, qdef->item_sz);
|
||||||
#endif
|
#endif
|
||||||
#if defined(configQUEUE_REGISTRY_SIZE) && (configQUEUE_REGISTRY_SIZE>0)
|
#if defined(configQUEUE_REGISTRY_SIZE) && (configQUEUE_REGISTRY_SIZE>0)
|
||||||
vQueueAddToRegistry(q, "tinyUSB");
|
vQueueAddToRegistry(q, qdef->pQueueName);
|
||||||
#endif
|
#endif
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user