cancel
Showing results for 
Search instead for 
Did you mean: 

port yielding is not working in free rtos

ajith sudhakaran
Associate
Posted on March 29, 2018 at 16:02

hi,

i had 3created three tasks, one for sd card writing another for interrrupt and another for displaying purpose.

interrupt task is not running when sd card task is created .

///task creation

xTaskCreate(vvDisplayTask, (const char) 'vDisplayTask', 128, NULL, tskIDLE_PRIORITY, NULL);

 

xTaskCreate(myint_task, (const char) 'int task', 128, NULL, tskIDLE_PRIORITY, &myint_handle);

xTaskCreate(vSDTASK, (const char) 'vSDTASKsd', 128, NULL, tskIDLE_PRIORITY, NULL);

 

vTaskStartScheduler()

 

/// my three tasks

 

void vSDTASK(void p)

{

FATFS fs;

FIL fil;

FRESULT res;

FILINFO MyFileInfo;

DIR MyDirectory;

UINT BytesWritten;

UINT BytesRead;

for(;;)

{

if(f_mount(&fs, '',1)== FR_OK)                            {                              GPIO_SetBits(GPIOC, GPIO_Pin_15);                              }                         if(f_open(&fil, 'carddaa.txt', FA_OPEN_ALWAYS | FA_WRITE)== FR_OK)                              {                             GPIO_SetBits(GPIOA, GPIO_Pin_1);                              res = f_write(&fil, 'just testing', 15, &BytesRead);                               }                       if(f_close(&fil)==FR_OK)                              {                                 GPIO_SetBits(GPIOC, GPIO_Pin_14);                               }      vTaskDelay(100000/portTICK_RATE_MS);     }  ///2 Task void myint_task( void * p )///interrupt task which is port yielding from ISR

{

while(1)

{

vTaskSuspend(NULL);

USART_PutStr('pressed');

count++;

}

}

void EXTI15_10_IRQHandler(void)// for interrupt task

{

BaseType_t checkIfYieldRequired;

checkIfYieldRequired=xTaskResumeFromISR(myint_handle);

portYIELD_FROM_ISR(checkIfYieldRequired);

EXTI_ClearITPendingBit(EXTI_Line12);

}

/// 3 Task

void vDisplayTask( void * p )

{

for(;;)

{

value=(count/4000)*60;

//count=0;

            USART_PutStr('\r\n');

USART_PutMsgAndVal('count',count/2,1);

vTaskDelay(4000/portTICK_RATE_MS);

}

}

interrupt task (myint_task) is not running when vSDTASK is running . what would be the problem please help me.

thanks and regard ajith.
0 REPLIES 0