I’m interested in allocating the command list in FreeRTOS+CLI statically instead of dynamically. I’m interested in contributing such a change but I would like some feedback on how to implement it.
I have thought of two different ways of doing this instead of using
CLI_Definition_List_Item_t on the heap.
Make something similar to cOutputBuffer which is extern when configAPPLICATION_PROVIDES_cOutputBuffer is set.
I.e. add a configCLI_STATIC_ALLOCATION configure define and if it’s set to 1 then use
extern CLI_Command_Definition_t * pxStaticCommandListand
extern UBaseType_t uxStaticCommandListLength.
BaseType_t FreeRTOS_CLICreateStatic( CLI_Command_Definition_t * pxStaticCommandList, const UBaseType_t uxStaticCommandListLength )function and if it’s called then use the static storage provided when
I’ll happily accept an other solution that might be better.
Additionally I wonder if I should
#ifdef configSUPPORT_STATIC_ALLOCATION all of the code related to this. I’ve noticed though that
configSUPPORT_DYNAMIC_ALLOCATION is not used in the current code.
Looking forward to your input.