prasaddait wrote on Monday, October 30, 2017:
I have three Threads Running in y code in main function I am declaring 3 Threads and suspend Two of them. My Interrupt Routine calls a function which after words resumes the one Task named “Swing”. But While this task is running whenever interrupt occurs it does not run at all.
Code is as follows:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_TIM3_Init();
MX_TIM4_Init();
MX_USART1_UART_Init();
MX_USART2_UART_Init();
MX_I2C2_Init();
/* USER CODE BEGIN 2 */
HAL_UART_Receive_IT(&huart2,(uint8_t )Rx_Data,1);
HAL_TIM_IC_Start_IT(&htim3,TIM_CHANNEL_2);
HAL_TIM_IC_Start_IT(&htim4,TIM_CHANNEL_1);
/ USER CODE END 2 */
/* USER CODE BEGIN RTOS_MUTEX /
/ add mutexes, … /
/ USER CODE END RTOS_MUTEX */
/* USER CODE BEGIN RTOS_SEMAPHORES /
/ add semaphores, … /
/ USER CODE END RTOS_SEMAPHORES */
/* USER CODE BEGIN RTOS_TIMERS /
/ start timers, add new ones, … /
/ USER CODE END RTOS_TIMERS */
/* Create the thread(s) /
/ definition and creation of defaultTask */
osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
/* USER CODE BEGIN RTOS_THREADS /
/ add threads, … */
osThreadDef(SwingTask, Swing, osPriorityNormal, 0, 128);
SwingTaskHandle = osThreadCreate(osThread(SwingTask), NULL);
osThreadDef(Task1, Task1, osPriorityNormal, 0, 100);
osThreadCreate(osThread(Task1), NULL);
vTaskSuspend(defaultTaskHandle);
vTaskSuspend(SwingTaskHandle);
vTaskStartScheduler();
/* USER CODE END RTOS_THREADS */
/* USER CODE BEGIN RTOS_QUEUES /
/ add queues, … */
/* USER CODE END RTOS_QUEUES */
/* Start scheduler */
osKernelStart();
/* We should never get here as control is now taken by the scheduler */
/* Infinite loop /
/ USER CODE BEGIN WHILE /
while (1)
{
/ USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}