BaseType_t
This is always defined to be the most efficient data type for the
architecture. Typically, this is a 32-bit type on a 32-bit architecture, a
16-bit type on a 16-bit architecture, and an 8-bit type on an 8-bit
architecture.
BaseType_t is generally used for variables that can take only a very
limited range of values, and for Booleans.
I was thing about “the most efficient data type for the architecture”,
for Booleans, is it better to choose type of _Bool;
and on a 32-bit architecture, is it the same efficient among type of data bit lower than 32. and more save memery.
Agreed, if a 32-bit variable is used as a boolean, you can see it as a waste of memory.
However, if the variable is an automatic variable, the optimiser will probably store it in a register, so it doesn’t cost any RAM at all.
I think that BaseType_t is an efficient data type because the compiler needs very few instructions to access it.
When you use 8- or 16-bit variables on a 32-bit platform, the compiler may have to add AND and cast instructions.
for Booleans, is it better to choose type of _Bool;
That also depends on how _Bool is implemented.
But you are free to use any C-dialect you like, and you can also use FreeRTOS in a mixed C/C++ project.
This is an interesting discussion about using booleans in C, it was started by Linus Torvalds.