Src/freertos.c
void MX_FREERTOS_Init(void) {
  /* USER CODE BEGIN Init */
       
  /* USER CODE END Init */
osKernelInitialize();

  /* USER CODE BEGIN RTOS_MUTEX */
  /* add mutexes, ... */
  /* USER CODE END RTOS_MUTEX */

  /* USER CODE BEGIN RTOS_SEMAPHORES */
  /* add semaphores, ... */
  /* USER CODE END RTOS_SEMAPHORES */

  /* Create the timer(s) */
  /* definition and creation of cmdReceiveTimeout */
  const osTimerAttr_t cmdReceiveTimeout_attributes = {
    .name = "cmdReceiveTimeout",
    .cb_mem = &cmdReceiveTimeoutControlBlock,
    .cb_size = sizeof(cmdReceiveTimeoutControlBlock),
  };
  cmdReceiveTimeoutHandle = osTimerNew(CmdReceiveTimeoutCallback, osTimerOnce, NULL, &cmdReceiveTimeout_attributes);

  /* USER CODE BEGIN RTOS_TIMERS */
  /* start timers, add new ones, ... */
  /* USER CODE END RTOS_TIMERS */

  /* Create the queue(s) */
  /* definition and creation of cmdRxQueue */
  const osMessageQueueAttr_t cmdRxQueue_attributes = {
    .name = "cmdRxQueue",
    .cb_mem = &cmdRxQueueControlBlock,
    .cb_size = sizeof(cmdRxQueueControlBlock),
    .mq_mem = &cmdRxQueueBuffer,
    .mq_size = sizeof(cmdRxQueueBuffer)
  };
  cmdRxQueueHandle = osMessageQueueNew (512, sizeof(uint8_t), &cmdRxQueue_attributes);

  /* definition and creation of cmdTxQueue */
  const osMessageQueueAttr_t cmdTxQueue_attributes = {
    .name = "cmdTxQueue",
    .cb_mem = &cmdTxQueueControlBlock,
    .cb_size = sizeof(cmdTxQueueControlBlock),
    .mq_mem = &cmdTxQueueBuffer,
    .mq_size = sizeof(cmdTxQueueBuffer)
  };
  cmdTxQueueHandle = osMessageQueueNew (512, sizeof(uint8_t), &cmdTxQueue_attributes);

  /* USER CODE BEGIN RTOS_QUEUES */
  /* add queues, ... */
  /* USER CODE END RTOS_QUEUES */

  /* Create the thread(s) */
  /* definition and creation of defaultTask */
  const osThreadAttr_t defaultTask_attributes = {
    .name = "defaultTask",
    .priority = (osPriority_t) osPriorityNormal,
    .stack_size = 128
  };
  defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);

  /* definition and creation of taskParseCmd */
  const osThreadAttr_t taskParseCmd_attributes = {
    .name = "taskParseCmd",
    .priority = (osPriority_t) osPriorityHigh,
    .stack_size = 1024
  };
  taskParseCmdHandle = osThreadNew(StartTaskParseCmd, NULL, &taskParseCmd_attributes);

  /* definition and creation of taskFeedWD */
  const osThreadAttr_t taskFeedWD_attributes = {
    .name = "taskFeedWD",
    .priority = (osPriority_t) osPriorityRealtime7,
    .stack_size = 128
  };
  taskFeedWDHandle = osThreadNew(StartTaskFeedWD, NULL, &taskFeedWD_attributes);

  /* USER CODE BEGIN RTOS_THREADS */
  /* add threads, ... */
  /* USER CODE END RTOS_THREADS */

}
/**
  * @brief  FreeRTOS initialization
  * @param  None
  * @retval None
  */
@brief  FreeRTOS initialization
@param  None
@retval None
@brief FreeRTOS initialization @param None @retval None
void MX_FREERTOS_Init(void) {
osKernelInitialize();
  const osTimerAttr_t cmdReceiveTimeout_attributes = {
    .name = "cmdReceiveTimeout",
    .cb_mem = &cmdReceiveTimeoutControlBlock,
    .cb_size = sizeof(cmdReceiveTimeoutControlBlock),
  };
  cmdReceiveTimeoutHandle = osTimerNew(CmdReceiveTimeoutCallback, osTimerOnce, NULL, &cmdReceiveTimeout_attributes);
  const osMessageQueueAttr_t cmdRxQueue_attributes = {
    .name = "cmdRxQueue",
    .cb_mem = &cmdRxQueueControlBlock,
    .cb_size = sizeof(cmdRxQueueControlBlock),
    .mq_mem = &cmdRxQueueBuffer,
    .mq_size = sizeof(cmdRxQueueBuffer)
  };
  cmdRxQueueHandle = osMessageQueueNew (512, sizeof(uint8_t), &cmdRxQueue_attributes);
  const osMessageQueueAttr_t cmdTxQueue_attributes = {
    .name = "cmdTxQueue",
    .cb_mem = &cmdTxQueueControlBlock,
    .cb_size = sizeof(cmdTxQueueControlBlock),
    .mq_mem = &cmdTxQueueBuffer,
    .mq_size = sizeof(cmdTxQueueBuffer)
  };
  cmdTxQueueHandle = osMessageQueueNew (512, sizeof(uint8_t), &cmdTxQueue_attributes);
  const osThreadAttr_t defaultTask_attributes = {
    .name = "defaultTask",
    .priority = (osPriority_t) osPriorityNormal,
    .stack_size = 128
  };
  defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
  const osThreadAttr_t taskParseCmd_attributes = {
    .name = "taskParseCmd",
    .priority = (osPriority_t) osPriorityHigh,
    .stack_size = 1024
  };
  taskParseCmdHandle = osThreadNew(StartTaskParseCmd, NULL, &taskParseCmd_attributes);
  const osThreadAttr_t taskFeedWD_attributes = {
    .name = "taskFeedWD",
    .priority = (osPriority_t) osPriorityRealtime7,
    .stack_size = 128
  };
  taskFeedWDHandle = osThreadNew(StartTaskFeedWD, NULL, &taskFeedWD_attributes);
}
void MX_FREERTOS_Init ( void ) { osKernelInitialize ( ) ; const osTimerAttr_t cmdReceiveTimeout_attributes = { . name = " " , . cb_mem = & cmdReceiveTimeoutControlBlock , . cb_size = sizeof ( cmdReceiveTimeoutControlBlock ) , } ; cmdReceiveTimeoutHandle = osTimerNew ( CmdReceiveTimeoutCallback , osTimerOnce , NULL , & cmdReceiveTimeout_attributes ) ; const osMessageQueueAttr_t cmdRxQueue_attributes = { . name = " " , . cb_mem = & cmdRxQueueControlBlock , . cb_size = sizeof ( cmdRxQueueControlBlock ) , . mq_mem = & cmdRxQueueBuffer , . mq_size = sizeof ( cmdRxQueueBuffer ) } ; cmdRxQueueHandle = osMessageQueueNew ( 512 , sizeof ( uint8_t ) , & cmdRxQueue_attributes ) ; const osMessageQueueAttr_t cmdTxQueue_attributes = { . name = " " , . cb_mem = & cmdTxQueueControlBlock , . cb_size = sizeof ( cmdTxQueueControlBlock ) , . mq_mem = & cmdTxQueueBuffer , . mq_size = sizeof ( cmdTxQueueBuffer ) } ; cmdTxQueueHandle = osMessageQueueNew ( 512 , sizeof ( uint8_t ) , & cmdTxQueue_attributes ) ; const osThreadAttr_t defaultTask_attributes = { . name = " " , . priority = ( osPriority_t ) osPriorityNormal , . stack_size = 128 } ; defaultTaskHandle = osThreadNew ( StartDefaultTask , NULL , & defaultTask_attributes ) ; const osThreadAttr_t taskParseCmd_attributes = { . name = " " , . priority = ( osPriority_t ) osPriorityHigh , . stack_size = 1024 } ; taskParseCmdHandle = osThreadNew ( StartTaskParseCmd , NULL , & taskParseCmd_attributes ) ; const osThreadAttr_t taskFeedWD_attributes = { . name = " " , . priority = ( osPriority_t ) osPriorityRealtime7 , . stack_size = 128 } ; taskFeedWDHandle = osThreadNew ( StartTaskFeedWD , NULL , & taskFeedWD_attributes ) ; }
@brief  FreeRTOS initialization
 @param  None
 @retval None
@brief FreeRTOS initialization @param None @retval None
/* USER CODE BEGIN Init */ /* USER CODE END Init */ /* USER CODE BEGIN RTOS_MUTEX */ /* add mutexes, ... */ /* USER CODE END RTOS_MUTEX */ /* USER CODE BEGIN RTOS_SEMAPHORES */ /* add semaphores, ... */ /* USER CODE END RTOS_SEMAPHORES */ /* Create the timer(s) */ /* definition and creation of cmdReceiveTimeout */ /* USER CODE BEGIN RTOS_TIMERS */ /* start timers, add new ones, ... */ /* USER CODE END RTOS_TIMERS */ /* Create the queue(s) */ /* definition and creation of cmdRxQueue */ /* definition and creation of cmdTxQueue */ /* USER CODE BEGIN RTOS_QUEUES */ /* add queues, ... */ /* USER CODE END RTOS_QUEUES */ /* Create the thread(s) */ /* definition and creation of defaultTask */ /* definition and creation of taskParseCmd */ /* definition and creation of taskFeedWD */ /* USER CODE BEGIN RTOS_THREADS */ /* add threads, ... */ /* USER CODE END RTOS_THREADS */