2020-08-25 01:06:50 +08:00
|
|
|
/* USER CODE BEGIN Header */
|
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
* File Name : app_freertos.c
|
|
|
|
* Description : Code for freertos applications
|
|
|
|
******************************************************************************
|
|
|
|
* @attention
|
|
|
|
*
|
2022-03-08 05:51:17 +08:00
|
|
|
* Copyright (c) 2022 STMicroelectronics.
|
|
|
|
* All rights reserved.
|
2020-08-25 01:06:50 +08:00
|
|
|
*
|
2022-03-08 05:51:17 +08:00
|
|
|
* This software is licensed under terms that can be found in the LICENSE file
|
|
|
|
* in the root directory of this software component.
|
|
|
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
2020-08-25 01:06:50 +08:00
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
/* USER CODE END Header */
|
|
|
|
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
#include "FreeRTOS.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
2020-11-24 23:28:57 +08:00
|
|
|
/* USER CODE BEGIN Includes */
|
2020-08-25 01:06:50 +08:00
|
|
|
|
|
|
|
/* USER CODE END Includes */
|
|
|
|
|
|
|
|
/* Private typedef -----------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN PTD */
|
|
|
|
|
|
|
|
/* USER CODE END PTD */
|
|
|
|
|
|
|
|
/* Private define ------------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN PD */
|
|
|
|
|
|
|
|
/* USER CODE END PD */
|
|
|
|
|
|
|
|
/* Private macro -------------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN PM */
|
|
|
|
|
|
|
|
/* USER CODE END PM */
|
|
|
|
|
|
|
|
/* Private variables ---------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN Variables */
|
|
|
|
|
|
|
|
/* USER CODE END Variables */
|
|
|
|
|
|
|
|
/* Private function prototypes -----------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN FunctionPrototypes */
|
2022-03-08 05:51:17 +08:00
|
|
|
|
2020-08-25 01:06:50 +08:00
|
|
|
/* USER CODE END FunctionPrototypes */
|
|
|
|
|
2020-08-30 22:20:00 +08:00
|
|
|
/* GetIdleTaskMemory prototype (linked to static allocation support) */
|
|
|
|
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize );
|
|
|
|
|
2022-08-07 09:01:22 +08:00
|
|
|
/* Hook prototypes */
|
|
|
|
void vApplicationIdleHook(void);
|
|
|
|
|
|
|
|
/* USER CODE BEGIN 2 */
|
|
|
|
__weak void vApplicationIdleHook( void )
|
|
|
|
{
|
|
|
|
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
|
|
|
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
|
|
|
task. It is essential that code added to this hook function never attempts
|
|
|
|
to block in any way (for example, call xQueueReceive() with a block time
|
|
|
|
specified, or call vTaskDelay()). If the application makes use of the
|
|
|
|
vTaskDelete() API function (as this demo application does) then it is also
|
|
|
|
important that vApplicationIdleHook() is permitted to return to its calling
|
|
|
|
function, because it is the responsibility of the idle task to clean up
|
|
|
|
memory allocated by the kernel to any task that has since been deleted. */
|
|
|
|
}
|
|
|
|
/* USER CODE END 2 */
|
|
|
|
|
2020-08-30 22:20:00 +08:00
|
|
|
/* USER CODE BEGIN GET_IDLE_TASK_MEMORY */
|
|
|
|
static StaticTask_t xIdleTaskTCBBuffer;
|
|
|
|
static StackType_t xIdleStack[configMINIMAL_STACK_SIZE];
|
2022-03-08 05:51:17 +08:00
|
|
|
|
2020-08-30 22:20:00 +08:00
|
|
|
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
|
|
|
|
{
|
|
|
|
*ppxIdleTaskTCBBuffer = &xIdleTaskTCBBuffer;
|
|
|
|
*ppxIdleTaskStackBuffer = &xIdleStack[0];
|
|
|
|
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
|
|
|
|
/* place for user code */
|
2022-03-08 05:51:17 +08:00
|
|
|
}
|
2020-08-30 22:20:00 +08:00
|
|
|
/* USER CODE END GET_IDLE_TASK_MEMORY */
|
|
|
|
|
2020-08-25 01:06:50 +08:00
|
|
|
/* Private application code --------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN Application */
|
2022-03-08 05:51:17 +08:00
|
|
|
|
2020-08-25 01:06:50 +08:00
|
|
|
/* USER CODE END Application */
|
|
|
|
|