[code.cpp]
#include <AR166.h> #include <stdio.h> OS_TID tsk1,tsk2_0,tsk2_1; int parameter[2] = {0, 1}; void task1 (void) __task 1 { tsk2_0 = os_tsk_create_ex (2, parameter[0]); tsk2_1 = os_tsk_create_ex (2, parameter[1]); } void task2 (int *argv) __task 2 { switch (*argv) { case 0: printf("This is a first instance of task2.\n"); break; case 1: printf("This is a second instance of task2.\n"); break; } while(1); }
compiling code.cpp... test_code.cpp(33): error: __interrupt/__using/__task function cannot receive/return value(s)
Sounds like it's doig exactly what it says on the tin: From the ARTX-166 User's Guide: "Tasks are simply C functions that have a void return type and a void argument list..." (my emphasis) http://www.keil.com/ar166/
In general __task functions do not receive parameters. After adding "..._ex" functions to AR166 Kernel, we have modified C166 compiler to allow a (void *) parameter for a task, but it seems that we forgot to update also an EC++ compiler. Thank you for pointing it out. Franc
All, Thank you for your replies. I can live without the "...ex" functions for a while. Steph-