/* USER CODE END Header_Normal_init */
void Normal_init(void const * argument)
{
/* USER CODE BEGIN 5 */
/* Infinite loop */
for(;;)
{
//while(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13));
char *msg1 = "hello mid\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg1, strlen (msg1), 100);
while(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13));
char *msg2 = "bye mid\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg2, strlen (msg2), 100);
osDelay(2000);
}
/* USER CODE END 5 */
}
/* USER CODE BEGIN Header_High_init */
/**
* @brief Function implementing the HighTask thread.
* @retval None
*/
/* USER CODE END Header_High_init */
void High_init(void const * argument)
{
/* USER CODE BEGIN High_init */
/* Infinite loop */
for(;;)
{
char *msg1 = "hello high\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg1, strlen(msg1), 100);
char *msg2 = "bye high\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg2, strlen(msg2), 100);
osDelay(1000);
}
/* USER CODE END High_init */
}
/* USER CODE BEGIN Header_Low_init */
/**
* @brief Function implementing the LowTask thread.
* @retval None
*/
/* USER CODE END Header_Low_init */
void Low_init(void const * argument)
{
/* USER CODE BEGIN Low_init */
/* Infinite loop */
for(;;)
{
char *msg1 = "hello low\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg1, strlen(msg1), 100);
char *msg2 = "bye low\r\n";
HAL_UART_Transmit(&huart3, (uint8_t *)msg2, strlen(msg2), 100);
osDelay(800);
}
/* USER CODE END Low_init */
}
Greetings!
I have defined 3 tasks high priority normal priority and a low priority,
The actual procedure is first the high priority task will execute and leave the high task after that it will just enter the medium priority task and will wait until the user button is pressed after it's pressed it will enter the low task and exit, if the button is not pressed it will go back executing the high priority task.
I'm not able to achieve that here, can somebody assist me?
I referred this video for this
FreeRTOS Tutorial 3.0 || Binary Semaphore || STM32 || CMSIS || CUBEIDE (youtube.com)