Chat freely about anything...

User avatar
By Johanan
#44050 Trying to compile a test program which uses system_os_task(), I get a linker error that it is undefined. other os_ functions work well (like os_timer_setfn() etc.).
declaration of system_os_task() is in user_interface.h, which is included in the source.

What am I missing ( using Arduino IDE)

Thanks,
Johanan
User avatar
By majorb
#44108 Without seeing your code, I'm guessing that you're not feeding it the right parameters .Does the function you're trying to register with system_os_task take an os_event_t * as a parameter?
system_os_task takes, in order:
-function(os_event_t *)
-an integer representing Task Priority
-an array of os_event_t representing a queue of tasks
-The length of the queue of tasks

Sample code:

#define TASK_PRIORITY 2
#define QUEUE_LENGTH 10

os_event_t queue[QUEUE_LENGTH];

void task_to_register(os_event_t *event)
{
//code, etc
}

void user_init()
{
//...
system_os_task(task_to_register, TASK_PRIORITY, queue, QUEUE_LENGTH);
//...
}