I want to create a task and pass a parameter to it. So I used function "os_tsk_create_ex" and define the task function as: void task3 (int *argv) __task 12 __priority 1{...}
When compiling this file, an error occurred: error: __interrupt/__using/__task function cannot receive/return value(s)
What's the reason of it? Thanks.
The reason is exactly as stated in the message:
error: __interrupt/__using/__task function cannot receive/return value(s)
"cannot" here could also be read as "must not" or "is not permitted to", etc...
Check the description of the __task keyword in the Manual:
http://www.keil.com/support/man/docs/tr166/tr166_taskdef.htm
It looks like you are using an older version of C166 compiler which does not yet support this.
What is your C166 version number?
Here is a related link: http://www.keil.com/forum/docs/thread7270.asp
What I use is uVision V3.21 and C166 compiler V6.02
But what i use is ARTX166, not RTX Tiny.
EC++ compiler V1.09
I'm not sure for the C166 version. My current version of C166 is v6.09a. We have introduced parameters passing to task with AR166 v2.00 released in august 2005.
The EC++ version supporting it is v1.09b
I suggest you download an update for your PK166. Then it should work.
Franc
I'll try it. Thank you very much