I want to indicate the beginnning and end of a task through digital outputs. that is the led will blink when the task starts and will blink again when the task has finished. . I have done some reading and i think i could use a macro but i am not sure.
Please is there a fuction that can do this or any suggestions about how i can go about it?
If you literally mean it goes high when the task begins execution, and then goes low at the very end of its execution, then I would just place the code at the begining and end of the task function.
Ont the other hand, if you mean goes high when the task becomes the currently executing task, and low when some other task is running, then I would use the trace macros to detect what task is being started and raise or lower it based on the new current task being that task or not (likely needed a global with the handle for that task)
I don’t think this has anything to do with the Eclipse IDE. Is this an
error in the editor window itself? If so, then ignore it, Eclipse tries
to parse the C code and will often get it wrong - only pay attention to
the compiler errors. If you compile the task.c file and
configUSE_APPLICATION_TASK_TAG is set to 1 then the function will be
available as can be seen on line 2784 (at the time of writing) here: https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/tasks.c
I did not find the file “task.c”. I accessed the contents of the file “libfreertos.a” (in the folder C: \ Espressif \ ESP8266_RTOS_SDK \ lib ", it had the file “task.o” without the function “vTaskSetApplicationTaskTag ()”.
In the directory “C: \ Espressif \ ESP8266_RTOS_SDK \ third_party \ frets” I found the file “tasks.c” with the definition of the function “vTaskSetApplicationTaskTag ()”. I put it in the project folder in libraries, left the definition of “tskTCB” and the function “vTaskSetApplicationTaskTag ()” and erased the rest of the file.
Now when compiling the following error appears within the function definition of the new tasks.c file:
build / app_app.a (tasks.o) .bss + 0x0): multiple definition of ‘pxCurrentTCB’
c: / Espressif / ESP8266_RTOS_SDK / lib \ libfreertos.a (tasks.o) :(. bss + 0x4): first defined here
The errors appear in the view “console” and “problems”.
Which project folder do I put the task.c to compile?
From your description it sounds like (I don’t know, as its not code
we are distributing ourselves) that FreeRTOS is built as a library.
Therefore, to change the FreeRTOS configuration, you will need to change
the files used to build the library - then re-build the library.