I'm using cmsis_os.c and cmsis_os.h provided in STMCubeMX. I found at least two place were cmsis_os.c should be fixed.
The first one:
#elif( configSUPPORT_STATIC_ALLOCATION == 1 )
return xTimerCreateStatic((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TaskFunction_t)timer_def->ptimer,
(StaticTimer_t *)timer_def->controlblock);
#else
return xTimerCreate((const char *)"",
1, // period should be filled when starting the Timer using osTimerStart
(type == osTimerPeriodic) ? pdTRUE : pdFALSE,
(void *) argument,
(TaskFunction_t)timer_def->ptimer);
#endif
Should TaskFunction_t be replaced with TimerCallbackFunction_t?
The second one:
osEvent osSignalWait (int32_t signals, uint32_t millisec)
{
osEvent ret;
#if( configUSE_TASK_NOTIFICATIONS == 1 )
TickType_t ticks;
ret.value.signals = 0;
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
I think it has to be:
osEvent osSignalWait (int32_t signals, uint32_t millisec)
{
osEvent ret;
#if( configUSE_TASK_NOTIFICATIONS == 1 )
TickType_t ticks;
if (signals == 0)
signals = ~0x80000000;
ret.value.signals = 0;
ticks = 0;
if (millisec == osWaitForever) {
ticks = portMAX_DELAY;
}
What do you think?
Is there a way to make STMCubeMX generating the patched file instead of the original one?
Thanks, Alberto
User contributions licensed under CC BY-SA 3.0