add new task

Firmware/software/electronics/mechanics
Post Reply
SH_Lee
Beginner
Posts: 22
Joined: Tue Feb 18, 2020 8:48 am

add new task

Post 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?
kimberly
Bitcraze
Posts: 518
Joined: Fri Jul 06, 2018 11:13 am

Re: add new task

Post 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!)
SH_Lee
Beginner
Posts: 22
Joined: Tue Feb 18, 2020 8:48 am

Re: add new task

Post 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?
kimberly
Bitcraze
Posts: 518
Joined: Fri Jul 06, 2018 11:13 am

Re: add new task

Post 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.
SH_Lee
Beginner
Posts: 22
Joined: Tue Feb 18, 2020 8:48 am

Re: add new task

Post 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?
kimberly
Bitcraze
Posts: 518
Joined: Fri Jul 06, 2018 11:13 am

Re: add new task

Post 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.
Post Reply