diff options
Diffstat (limited to 'demos/host/src')
| -rw-r--r-- | demos/host/src/cdc_serial_host_app.c | 13 | ||||
| -rw-r--r-- | demos/host/src/cdc_serial_host_app.h | 2 | ||||
| -rw-r--r-- | demos/host/src/keyboard_host_app.c | 14 | ||||
| -rw-r--r-- | demos/host/src/keyboard_host_app.h | 2 | ||||
| -rw-r--r-- | demos/host/src/main.c | 1 | ||||
| -rw-r--r-- | demos/host/src/mouse_host_app.c | 14 | ||||
| -rw-r--r-- | demos/host/src/mouse_host_app.h | 2 | ||||
| -rw-r--r-- | demos/host/src/msc_host_app.c | 8 | ||||
| -rw-r--r-- | demos/host/src/msc_host_app.h | 2 | ||||
| -rw-r--r-- | demos/host/src/rndis_host_app.c | 2 | ||||
| -rw-r--r-- | demos/host/src/rndis_host_app.h | 2 |
11 files changed, 24 insertions, 38 deletions
diff --git a/demos/host/src/cdc_serial_host_app.c b/demos/host/src/cdc_serial_host_app.c index 14b052739..62ed3e1ee 100644 --- a/demos/host/src/cdc_serial_host_app.c +++ b/demos/host/src/cdc_serial_host_app.c @@ -46,10 +46,7 @@ //--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-OSAL_TASK_DEF(cdc_serial_host_app_task, 128, CDC_SERIAL_APP_TASK_PRIO);
-OSAL_SEM_DEF(serial_semaphore);
-
-static osal_semaphore_handle_t sem_hdl;
+static osal_semaphore_t sem_hdl;
enum { SERIAL_BUFFER_SIZE = 64 };
TUSB_CFG_ATTR_USBRAM static uint8_t serial_in_buffer[SERIAL_BUFFER_SIZE];
@@ -115,16 +112,16 @@ void tuh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id //--------------------------------------------------------------------+
void cdc_serial_host_app_init(void)
{
- sem_hdl = osal_semaphore_create( OSAL_SEM_REF(serial_semaphore) );
+ sem_hdl = osal_semaphore_create(1, 0);
ASSERT_PTR( sem_hdl, VOID_RETURN);
- ASSERT( TUSB_ERROR_NONE == osal_task_create(OSAL_TASK_REF(cdc_serial_host_app_task)), VOID_RETURN);
+ VERIFY( osal_task_create(cdc_serial_host_app_task, "cdc", 128, NULL, CDC_SERIAL_APP_TASK_PRIO, NULL), );
}
//------------- main task -------------//
-OSAL_TASK_FUNCTION( cdc_serial_host_app_task, p_task_para)
+void cdc_serial_host_app_task( void* param )
{
- (void) p_task_para;
+ (void) param;
OSAL_TASK_LOOP_BEGIN
diff --git a/demos/host/src/cdc_serial_host_app.h b/demos/host/src/cdc_serial_host_app.h index f041b1467..78bdbdc24 100644 --- a/demos/host/src/cdc_serial_host_app.h +++ b/demos/host/src/cdc_serial_host_app.h @@ -56,7 +56,7 @@ #if TUSB_CFG_HOST_CDC
void cdc_serial_host_app_init(void);
-OSAL_TASK_FUNCTION( cdc_serial_host_app_task, p_task_para);
+void cdc_serial_host_app_task(void* param);
#else
diff --git a/demos/host/src/keyboard_host_app.c b/demos/host/src/keyboard_host_app.c index 4c85d5d3b..d5d39d428 100644 --- a/demos/host/src/keyboard_host_app.c +++ b/demos/host/src/keyboard_host_app.c @@ -52,10 +52,7 @@ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-OSAL_TASK_DEF(keyboard_host_app_task, 128, KEYBOARD_APP_TASK_PRIO);
-OSAL_QUEUE_DEF(queue_kbd_def, QUEUE_KEYBOARD_REPORT_DEPTH, hid_keyboard_report_t);
-
-static osal_queue_handle_t queue_kbd_hdl;
+static osal_queue_t queue_kbd_hdl;
TUSB_CFG_ATTR_USBRAM static hid_keyboard_report_t usb_keyboard_report;
static inline uint8_t keycode_to_ascii(uint8_t modifier, uint8_t keycode) ATTR_CONST ATTR_ALWAYS_INLINE;
@@ -105,17 +102,16 @@ void keyboard_host_app_init(void) {
memclr_(&usb_keyboard_report, sizeof(hid_keyboard_report_t));
- queue_kbd_hdl = osal_queue_create( OSAL_QUEUE_REF(queue_kbd_def) );
+ queue_kbd_hdl = osal_queue_create( QUEUE_KEYBOARD_REPORT_DEPTH, sizeof(hid_keyboard_report_t) );
ASSERT_PTR( queue_kbd_hdl, VOID_RETURN );
- ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(keyboard_host_app_task) ) ,
- VOID_RETURN);
+ VERIFY( osal_task_create(keyboard_host_app_task, "kbd", 128, NULL, KEYBOARD_APP_TASK_PRIO, NULL), );
}
//------------- main task -------------//
-OSAL_TASK_FUNCTION( keyboard_host_app_task, p_task_para)
+void keyboard_host_app_task(void* param)
{
- (void) p_task_para;
+ (void) param;
OSAL_TASK_LOOP_BEGIN
diff --git a/demos/host/src/keyboard_host_app.h b/demos/host/src/keyboard_host_app.h index ec27d5d89..96deb15c1 100644 --- a/demos/host/src/keyboard_host_app.h +++ b/demos/host/src/keyboard_host_app.h @@ -62,7 +62,7 @@ #if TUSB_CFG_HOST_HID_KEYBOARD
void keyboard_host_app_init(void);
-OSAL_TASK_FUNCTION( keyboard_host_app_task, p_task_para);
+void keyboard_host_app_task(void* param);
#else
diff --git a/demos/host/src/main.c b/demos/host/src/main.c index f7d3b1a7c..66ca6456c 100644 --- a/demos/host/src/main.c +++ b/demos/host/src/main.c @@ -123,7 +123,6 @@ void print_greeting(void) {
[TUSB_OS_NONE] = "None",
[TUSB_OS_FREERTOS] = "FreeRTOS",
- [TUSB_OS_CMSIS_RTX] = "CMSIS-RTX"
};
puts("\n\
diff --git a/demos/host/src/mouse_host_app.c b/demos/host/src/mouse_host_app.c index 23a3e9b5c..a68510f66 100644 --- a/demos/host/src/mouse_host_app.c +++ b/demos/host/src/mouse_host_app.c @@ -52,10 +52,7 @@ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-OSAL_TASK_DEF(mouse_host_app_task, 128, MOUSE_APP_TASK_PRIO);
-OSAL_QUEUE_DEF(queue_mouse_def, QUEUE_MOUSE_REPORT_DEPTH, hid_mouse_report_t);
-
-static osal_queue_handle_t queue_mouse_hdl;
+static osal_queue_t queue_mouse_hdl;
TUSB_CFG_ATTR_USBRAM static hid_mouse_report_t usb_mouse_report;
static inline void process_mouse_report(hid_mouse_report_t const * p_report);
@@ -106,17 +103,16 @@ void mouse_host_app_init(void) {
memclr_(&usb_mouse_report, sizeof(hid_mouse_report_t));
- queue_mouse_hdl = osal_queue_create( OSAL_QUEUE_REF(queue_mouse_def) );
+ queue_mouse_hdl = osal_queue_create( QUEUE_MOUSE_REPORT_DEPTH, sizeof(hid_mouse_report_t) );
ASSERT_PTR( queue_mouse_hdl, VOID_RETURN);
- ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(mouse_host_app_task) ),
- VOID_RETURN );
+ VERIFY( osal_task_create(mouse_host_app_task, "mouse", 128, NULL, MOUSE_APP_TASK_PRIO, NULL), );
}
//------------- main task -------------//
-OSAL_TASK_FUNCTION( mouse_host_app_task, p_task_para)
+void mouse_host_app_task(void* param)
{
- (void) p_task_para;
+ (void) param;
OSAL_TASK_LOOP_BEGIN
diff --git a/demos/host/src/mouse_host_app.h b/demos/host/src/mouse_host_app.h index fdd697353..05f1541f9 100644 --- a/demos/host/src/mouse_host_app.h +++ b/demos/host/src/mouse_host_app.h @@ -65,7 +65,7 @@ #if TUSB_CFG_HOST_HID_MOUSE
void mouse_host_app_init(void);
-OSAL_TASK_FUNCTION( mouse_host_app_task, p_task_para);
+void mouse_host_app_task(void* param);
#else
diff --git a/demos/host/src/msc_host_app.c b/demos/host/src/msc_host_app.c index d4fe001d1..59a17b1ad 100644 --- a/demos/host/src/msc_host_app.c +++ b/demos/host/src/msc_host_app.c @@ -55,8 +55,6 @@ //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-OSAL_TASK_DEF(msc_host_app_task, 512, MSC_APP_TASK_PRIO);
-
TUSB_CFG_ATTR_USBRAM static FATFS fatfs[TUSB_CFG_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
@@ -143,14 +141,14 @@ void tuh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes) //--------------------------------------------------------------------+
void msc_host_app_init(void)
{
- ASSERT( TUSB_ERROR_NONE == osal_task_create( OSAL_TASK_REF(msc_host_app_task) ), VOID_RETURN );
+ osal_task_create( msc_host_app_task, "msc", 512, NULL, MSC_APP_TASK_PRIO, NULL);
diskio_init();
}
//------------- main task -------------//
-OSAL_TASK_FUNCTION( msc_host_app_task, p_task_para)
+void msc_host_app_task(void* param)
{
- (void) p_task_para;
+ (void) param;;
OSAL_TASK_LOOP_BEGIN
diff --git a/demos/host/src/msc_host_app.h b/demos/host/src/msc_host_app.h index 0a447be05..4736f33d4 100644 --- a/demos/host/src/msc_host_app.h +++ b/demos/host/src/msc_host_app.h @@ -57,7 +57,7 @@ #if TUSB_CFG_HOST_MSC
void msc_host_app_init(void);
-OSAL_TASK_FUNCTION( msc_host_app_task, p_task_para);
+void msc_host_app_task(void* param);
#else
diff --git a/demos/host/src/rndis_host_app.c b/demos/host/src/rndis_host_app.c index 50d788a02..4b33144d8 100644 --- a/demos/host/src/rndis_host_app.c +++ b/demos/host/src/rndis_host_app.c @@ -67,7 +67,7 @@ void rndis_host_app_init(void) } -OSAL_TASK_FUNCTION( rndis_host_app_task, p_task_para) +void rndis_host_app_task(void* param) { OSAL_TASK_LOOP_BEGIN OSAL_TASK_LOOP_END diff --git a/demos/host/src/rndis_host_app.h b/demos/host/src/rndis_host_app.h index a7add847d..e4fcacf46 100644 --- a/demos/host/src/rndis_host_app.h +++ b/demos/host/src/rndis_host_app.h @@ -56,7 +56,7 @@ #if TUSB_CFG_HOST_CDC && TUSB_CFG_HOST_CDC_RNDIS void rndis_host_app_init(void); -OSAL_TASK_FUNCTION( rndis_host_app_task, p_task_para); +void rndis_host_app_task(void* param); #else |
