gary10es wrote on Monday, December 14, 2009:
Hello everybody, i have a problem with the time in communicate my interrupt and one task while a semaphore.
My tick is 1mseg, and the frecuency of my micro in EVK1100 is 66Mhz.
the code is that
//************************************************************************************************
/
__attribute__((__noinline__))
static portBASE_TYPE eic_int_handlerPRI_NonNakedBehaviour( void )
{
portBASE_TYPE retstatus,retstatus2;
portBASE_TYPE xTaskWoken = pdFALSE;
Cont++;
if ( (F_Count_P==1) && (-Num_Execute_P==0))
{
F_Count_P=0;
/* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
calls in a critical section . */
portENTER_CRITICAL();
retstatus=xSemaphoreGiveFromISR( xSemaphoreSendP, xTaskWoken );
portEXIT_CRITICAL();
/* The return value will be used by portEXIT_SWITCHING_ISR() to know if it
should perform a vTaskSwitchContext(). */
if (retstatus)
xTaskWoken = pdTRUE;
}
/* The return value will be used by portEXIT_SWITCHING_ISR() to know if it
should perform a vTaskSwitchContext(). */
// False because don’t change the task when the interrupt happened.!!!!!!
//Reset the Interrupt
eic_clear_interrupt_line(&AVR32_EIC, EXT_INT0);
return (xTaskWoken);
}
and the task to unblock with this semaphore is this:
static portTASK_FUNCTION( vTxRxPCUTask, pvParameters )
{
const portTickType xTicksToWait=TIMEOUT/portTICK_RATE_MS; //Ponemos el timeout en mseg como cte.Se aplica a todos
unsigned short i,j;
unsigned short length_aux;
_dataword aux;
_datadoubleword aux2;
( void ) pvParameters;
while(1)
{
xSemaphoreTake(xSemaphoreSendP,portMAX_DELAY);
…. // rest of code
}
the time beetwen the semaphoreGive and the semaphore Take is about 70 microsecond, and i want to reduce this time
is there any possibilitty? need i use co-routine? can i use a flag in the interrupt and the task every moment see the flag ?
any idea ?
thanks
Oliver