Update FreeRTOS

This commit is contained in:
Ben V. Brown
2022-10-22 10:57:56 +11:00
parent 6c69c2e241
commit d5f33814aa
33 changed files with 20339 additions and 16800 deletions

View File

@@ -548,107 +548,6 @@ osStatus osTimerDelete(osTimerId timer_id)
return result;
}
/*************************** Signal Management ********************************/
/**
* @brief Set the specified Signal Flags of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param signals specifies the signal flags of the thread that should be set.
* @retval previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
* @note MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.
*/
int32_t osSignalSet(osThreadId thread_id, int32_t signal)
{
#if (configUSE_TASK_NOTIFICATIONS == 1)
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
uint32_t ulPreviousNotificationValue = 0;
if (inHandlerMode())
{
if (xTaskGenericNotifyFromISR(thread_id, (uint32_t)signal, eSetBits, &ulPreviousNotificationValue, &xHigherPriorityTaskWoken) != pdPASS)
return 0x80000000;
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
else if (xTaskGenericNotify(thread_id, (uint32_t)signal, eSetBits, &ulPreviousNotificationValue) != pdPASS)
return 0x80000000;
return ulPreviousNotificationValue;
#else
(void)thread_id;
(void)signal;
return 0x80000000; /* Task Notification not supported */
#endif
}
/**
* @brief Clear the specified Signal Flags of an active thread.
* @param thread_id thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param signals specifies the signal flags of the thread that shall be cleared.
* @retval previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.
* @note MUST REMAIN UNCHANGED: \b osSignalClear shall be consistent in every CMSIS-RTOS.
*/
int32_t osSignalClear(osThreadId thread_id, int32_t signal);
/**
* @brief Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.
* @param signals wait until all specified signal flags set or 0 for any single signal flag.
* @param millisec timeout value or 0 in case of no time-out.
* @retval event flag information or error code.
* @note MUST REMAIN UNCHANGED: \b osSignalWait shall be consistent in every CMSIS-RTOS.
*/
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;
}
else if (millisec != 0)
{
ticks = millisec / portTICK_PERIOD_MS;
if (ticks == 0)
{
ticks = 1;
}
}
if (inHandlerMode())
{
ret.status = osErrorISR; /*Not allowed in ISR*/
}
else
{
if (xTaskNotifyWait(0, (uint32_t)signals, (uint32_t *)&ret.value.signals, ticks) != pdTRUE)
{
if (ticks == 0)
ret.status = osOK;
else
ret.status = osEventTimeout;
}
else if (ret.value.signals < 0)
{
ret.status = osErrorValue;
}
else
ret.status = osEventSignal;
}
#else
(void)signals;
(void)millisec;
ret.status = osErrorOS; /* Task Notification not supported */
#endif
return ret;
}
/**************************** Mutex Management ********************************/
/**