Implementation of prvInitialiseNewTask

FrAxl93
Posts: 4
Joined: Tue Aug 28, 2018 8:49 pm

Implementation of prvInitialiseNewTask

Postby FrAxl93 » Tue Aug 28, 2018 9:03 pm

Good evening everyone,

I was browsing the source code of the IDF libs, particuarly I was looking in the FreeRTOS folder. I wished to learn about the implementation of "xTaskCreateStaticPinnedToCore", which is re-implemented by IDF to allow the user to specify which core should run the task. As I proceed I saw the "prvInitialiseNewTask" function and I wanted to look at the implementation but I was a bit disappointed that there is no implementation of this function in any file. In tasks.c there is only the definition and then the macro PRIVILEGED_FUNCTION, which I discovered to be just a directive to the MPU. What I noticed is that the "prvInitialiseNewTask" has an implementation in tasks.c in the original FreeRTOS repo, but here no. I just wonder why.

Regards,
Francesco.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: IDF-FreeRTOS source code

Postby ESP_Angus » Wed Aug 29, 2018 2:37 am

Hi Francesco,

I think what you saw is what is called a "forward declaration" in C, of a static function declared later in the file.

The full function is also in there: https://github.com/espressif/esp-idf/bl ... sks.c#L859

(Note: I renamed this topic to be more specific about the question.)

Angus

FrAxl93
Posts: 4
Joined: Tue Aug 28, 2018 8:49 pm

Re: Implementation of prvInitialiseNewTask

Postby FrAxl93 » Fri Aug 31, 2018 6:30 am

Good morning Angus and thanks for your answer. I am a bit embarrassed because I know what forward declarations are in C, but for some reason the regexp that I was using to search the implementation of the function was finding only the declaration.

I wrongly thought that it might have been a function in a compiled library, which was exposing only the declaration!

Thanks!

Who is online

Users browsing this forum: ESP_Sprite, Google [Bot] and 54 guests