Is it permitted to give a semaphore before starting the FreeRTOS kernel?
I have some C++ classes that utilize FreeRTOS objects and there is one that wraps a binary semaphore and creates it with xSemaphoreCreateBinaryStatic
. I’d like it start in the available state so ideally it would give the semaphore in the constructor, but since I statically allocate most things that would mean the constructor would run during global static object initialization, before the kernel has started.
I’ve tried this out and it seems to work without triggering any assertions, but is this normally allowable or just working by coincidence?