What's the role of function workerLoop

Discussions about quadcopters/multi-rotors
Post Reply
wenlong
Beginner
Posts: 7
Joined: Tue Sep 20, 2016 10:15 am

What's the role of function workerLoop

Post by wenlong »

I did not really understand the role of workerLoop, could anyone give some suggestion, thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: What's the role of function workerLoop

Post by arnaud »

Hi wenlong,

Could you maybe add some context? I am assuming you are talking about the Crazyflie firmware but since you are posting in general/quadcopters I am not sure. What worker loop are you referring to?

Best,
Arnaud
wenlong
Beginner
Posts: 7
Joined: Tue Sep 20, 2016 10:15 am

Re: What's the role of function workerLoop

Post by wenlong »

Hi arnuad,
I'm sorry to reply you so late1
Yes, I did talk about the Crazyflie firmware. The function workerLoop is called in file system.c and defined in file worker.c.
I think this function was just used for communication logs? Is this right?
Sincerely
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: What's the role of function workerLoop

Post by arnaud »

Hi,

The worker loop is a generic system that allows to run functions asynchronously. It is possible that it is used only for log in the current firmware but it is designed as a generic mechanism that could be used by other subsystem. The idea was that if a subsystem needs to run low priority non-real time quick jobs there should be no need to have a task for it, the worker loop can carry these jobs.

Best,
Arnaud
wenlong
Beginner
Posts: 7
Joined: Tue Sep 20, 2016 10:15 am

Re: What's the role of function workerLoop

Post by wenlong »

Thanks, arnuad! I got it
Post Reply