INCLUDE_xTaskDelayUntil vs INCLUDE_vTaskDelayUntil

In FreeRTOS. h file I see that

 /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil.  Backward         * compatibility is maintained if only one or the other is defined, but         * there is a conflict if both are defined. */

and so I would expect that now it should be better (best practise) defining INCLUDE_xTaskDelayUntil instead of INCLUDE_vTaskDelayUntil.

Biut in the FreeRTOSConfig.h that I find on github I see

#define INCLUDE_vTaskDelayUntil 1

I know that everyhting works (because of the backward compatibility), but would you think that this can be updated?

The header file FreeRTOS.h is part of the kernel, it is recommended to use it as it is.

The file FreeRTOSConfig.h is part of your project, and you can change it as you like.

Macro’s within FreeRTOS always have a value, such as:

#define INCLUDE_vTaskDelayUntil   1

So the code can use #if to test the macro, in stead of #ifdef.

Yes, I know.

Probably I didn’t express well my thoughts.

This file FreeRTOS-Kernel/examples/template_configuration/FreeRTOSConfig.h at e5987bbdb2041f70c9502f99a8c5643a30b9ff26 · FreeRTOS/FreeRTOS-Kernel · GitHub in the official FreeRTOS-Kernel repo is a kind of template that every user can use as starting point.

And it defines the old INCLUDE_vTaskDelayUntil and not the new INCLUDE_xTaskDelayUntil.

I know perfectly this is a minor topic and everyone can easily customize its own FreeRTOSConfig.h file.

Ah yes, that should be changed. It is the a template for [MPLAB PIC32MZ-EF](MPLAB PIC32MZ-EF - Adds an assert to catch register overflow (#1265) … · FreeRTOS/FreeRTOS-Kernel@4ee6a1f · GitHub "MPLAB PIC32MZ-EF - Adds an assert to catch register overflow (#1265) (#1267)

Add an assert to catch register overflow (#1265)").

It must be said that FreeRTOS.h checks for double declarations:

#ifdef INCLUDE_xTaskDelayUntil
    #ifdef INCLUDE_vTaskDelayUntil
        #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined.  INCLUDE_vTaskDelayUntil is no longer required and should be removed
    #endif
#endif

Thanks for reporting.

Thanks for noticing this! I have made the change to the kernel template file and will have the website updated shortly. The vTaskDelayUntil page will direct new users to using xTaskDelayUntil. xTaskDelayUntil has been updated to remove a typo in the inclusion macro.

2 Likes