diff options
| author | hathach <[email protected]> | 2013-04-23 15:35:27 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-04-23 15:35:27 +0700 |
| commit | 73d5f00a40dcdc9a84e0f915d0ff349f231444c6 (patch) | |
| tree | 309c3552bc787e8b76566ed2c750455587411ca5 /demos/host/src | |
| parent | 0b9f553f81fd524071ae8f7767c6a260f67ee789 (diff) | |
rename OSAL_TASK_DECLARE to OSAL_TASK_FUNCTION
removing TASK_ASSERT to avoid using goto/continue statement with rtos configure
Diffstat (limited to 'demos/host/src')
| -rw-r--r-- | demos/host/src/keyboard_app.c | 9 | ||||
| -rw-r--r-- | demos/host/src/keyboard_app.h | 2 | ||||
| -rw-r--r-- | demos/host/src/mouse_app.c | 2 | ||||
| -rw-r--r-- | demos/host/src/mouse_app.h | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/demos/host/src/keyboard_app.c b/demos/host/src/keyboard_app.c index 1a58daa05..0d543e589 100644 --- a/demos/host/src/keyboard_app.c +++ b/demos/host/src/keyboard_app.c @@ -97,7 +97,7 @@ void keyboard_app_init(void) } //------------- main task -------------// -OSAL_TASK_DECLARE( keyboard_app_task ) +OSAL_TASK_FUNCTION( keyboard_app_task ) { tusb_error_t error; tusb_keyboard_report_t kbd_report; @@ -106,12 +106,19 @@ OSAL_TASK_DECLARE( keyboard_app_task ) osal_queue_receive(q_kbd_report_hdl, &kbd_report, OSAL_TIMEOUT_WAIT_FOREVER, &error); + bool has_key = false; for(uint8_t i=0; i<6; i++) { if ( kbd_report.keycode[i] != 0 ) + { printf("%c", keycode_to_ascii(kbd_report.keycode[i])); + has_key = true; + } } + if (has_key) + printf("\n"); + memclr_(&kbd_report, sizeof(tusb_keyboard_report_t) ); OSAL_TASK_LOOP_END diff --git a/demos/host/src/keyboard_app.h b/demos/host/src/keyboard_app.h index 9fa574d2d..1f71e4006 100644 --- a/demos/host/src/keyboard_app.h +++ b/demos/host/src/keyboard_app.h @@ -63,7 +63,7 @@ void keyboard_app_init(void); -OSAL_TASK_DECLARE( keyboard_app_task ); +OSAL_TASK_FUNCTION( keyboard_app_task ); #ifdef __cplusplus } diff --git a/demos/host/src/mouse_app.c b/demos/host/src/mouse_app.c index 89dd7d6b5..81b5f2e6f 100644 --- a/demos/host/src/mouse_app.c +++ b/demos/host/src/mouse_app.c @@ -96,7 +96,7 @@ void mouse_app_init(void) } //------------- main task -------------// -OSAL_TASK_DECLARE( mouse_app_task ) +OSAL_TASK_FUNCTION( mouse_app_task ) { tusb_error_t error; tusb_mouse_report_t mouse_report; diff --git a/demos/host/src/mouse_app.h b/demos/host/src/mouse_app.h index 7c5972310..3830424da 100644 --- a/demos/host/src/mouse_app.h +++ b/demos/host/src/mouse_app.h @@ -62,7 +62,7 @@ #endif void mouse_app_init(void); -OSAL_TASK_DECLARE( mouse_app_task ); +OSAL_TASK_FUNCTION( mouse_app_task ); #ifdef __cplusplus } |
