diff options
| author | hathach <[email protected]> | 2018-05-17 20:04:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-05-17 20:04:52 +0700 |
| commit | 3a64acaa28222cda74d9b1dc97a028951ed26688 (patch) | |
| tree | 05f8b7546e35ea3d8cf651af741a2d602df2b315 /tinyusb | |
| parent | ea7efb0fd63e872aedadb9387ecb4877cb2044bd (diff) | |
complete enhancing osal with static memory
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/device/usbd.c | 4 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index 7fa73edbc..9fe6a5446 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -169,6 +169,8 @@ typedef struct ATTR_ALIGNED(4) VERIFY_STATIC(sizeof(usbd_task_event_t) <= 12, "size is not correct");
+OSAL_TASK_DEF(_usbd_task_def, "usbd", usbd_task, CFG_TUD_TASK_PRIO, CFG_TUD_TASK_STACKSIZE);
+
/*------------- event queue -------------*/
OSAL_QUEUE_DEF(_usbd_qdef, USBD_TASK_QUEUE_DEPTH, usbd_task_event_t);
static osal_queue_t _usbd_q;
@@ -220,7 +222,7 @@ tusb_error_t usbd_init (void) _usbd_ctrl_sem = osal_semaphore_create(&_usbd_sem_def);
VERIFY(_usbd_q, TUSB_ERROR_OSAL_SEMAPHORE_FAILED);
- osal_task_create(usbd_task, "usbd", CFG_TUD_TASK_STACKSIZE, NULL, CFG_TUD_TASK_PRIO);
+ osal_task_create(&_usbd_task_def);
//------------- Core init -------------//
arrclr_( _usbd_descs );
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 575a2229a..5b13fcbfa 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -65,13 +65,15 @@ //
// NOTE: no switch statement is allowed in Task and subtask
//--------------------------------------------------------------------+
-typedef void (*osal_func_t)(void *param);
+#define OSAL_TASK_DEF(_name, _str, _func, _prio, _stack_sz) osal_task_def_t _name;
+
+typedef uint8_t osal_task_def_t;
typedef void* osal_task_t;
-static inline osal_task_t osal_task_create(osal_func_t code, const char* name, uint32_t stack_size, void* param, uint32_t prio)
+static inline osal_task_t osal_task_create(osal_task_def_t* taskdef)
{
- (void) code; (void) name; (void) stack_size; (void) param; (void) prio;
- return (osal_task_t) 1;
+ (void) taskdef;
+ return (osal_task_t) 1; // return non zero
}
#define TASK_RESTART \
|
