hi
i'm searching how to dynamically create mutex in CMSIS-RTOS/KEIL.
i saw the osMutexCreate only accept const osMutexDef_t *
do you know how i can manage to create a mutex, runtime and dynamically allocated in memory please ?
i'm porting a code where there is Mutex_Create(); everywhere so i didn't found other possibilities, yet.
thank you
best regards KArl
Don't forget that what Linux does is irrelevant when you get to embedded systems with often very limited amount of RAM.
The design is made on the assumption that you should be able to write applications with zero involvement of malloc/free, which means there will not be any issues with any fragmented heap making the software fail after having been run for a longer time. The smaller heap you have, the more danger you have of fragmentation killing the application.
So what is done is a general-purpose OS is irrelevant when discussing an implementation for smaller microcontrollers.
It's possible to abuse the original macros a bit to make it easy to set up a pool of mutex as an array.