Page 1 of 1

add new task

Posted: Thu Aug 13, 2020 12:41 pm
by SH_Lee
I would like to add a new task.
As a result of following the example on the homepage, I got the desired output.

I've added some code to go further and do what I want.
But I couldn't get the result I wanted.
Do I have to make additional settings?


////////////////////////////////////////////////////////////////
https://www.bitcraze.io/documentation/r ... ystemtask/
////////////////////////////////////////////////////////////////

static void exampleTask(void* parameters) {
DEBUG_PRINT("Example task main function is running!");
while (true) {
int input;
if (pdTRUE == xQueueReceive(inputQueue, &input, portMAX_DELAY)) {
// Respond to input here!
void ledClearAll(); //add here
vTaskDelay(M2T(100)); //add here
}
}
}
////////////////////////////////////////////////////////////////

I wanted to make sure my rtos were working properly.
Is there any part where I need to modify the existing rtos queue without adding a separate deck?

Re: add new task

Posted: Fri Aug 14, 2020 9:20 am
by kimberly
Hi!

Why not use the new app layer application?


The instructions are here and I've just added an example folder to the crazyflie-firmware repo with an hello world example (see this ticket since more are coming!)

Re: add new task

Posted: Tue Aug 18, 2020 10:26 am
by SH_Lee
I wanted to create a task that was called repeatedly like any other task.
As a result of executing the examples, we have confirmed that the stablizer task only runs once before it is called.
The Helloworld example was executed only once, so it wasn't the result I wanted.
Is there an example code that I want to do what I want?

Re: add new task

Posted: Tue Aug 18, 2020 10:49 am
by kimberly
The app layer task is actually like any other task. Its exactly the same

What do you mean with the hello world example only executed once ? It is in a while loop and executed every two seconds.

Re: add new task

Posted: Wed Aug 19, 2020 8:37 am
by SH_Lee
I tried to do this inside Eclipse IDE.
I think there was a problem here.
The current Hello world example works perfectly.
However, it only worked when running in a terminal.
Is there a way to do this in Eclipse?

Re: add new task

Posted: Thu Aug 20, 2020 8:11 am
by kimberly
With 'trying to do this in eclipse IDE', do you mean that you want to use the 'make targets' (with green concentric circles). These are shortcuts of what you can do in the terminal anyway.

How to make new make targets, please look into the eclipse IDE documentation yourself. However, since you are getting into the embedded programming, I would advise to also stick with the terminal based making since you can immediately see what is going on and what is happening.