Hello:
Actually 2 questions here:
1 – The Queue handle has to get from one source file/function to the source file for the ISR. Is the best way to do this through an extern declaration?
in MAIN: QueueHandle
t isrQueue;
in ISR file: extern QueueHandlet isrQueue;
2 – The queue task for receive does not seem to be detecting the send update. Here’s the declarations:
void QueueRxFunction( void *pvParameters );
QueueHandle_t isrQueue;
TaskHandle_t xQueueTask = NULL;
define rxQueue_RATE ( portMAX_DELAY )
isrQueue = xQueueCreate( 1, sizeof(uint8
t) );
xTaskCreate( QueueRxFunction, “rxDataQueue”, 140, NULL, 2, (TaskHandlet)xQueueTask );
Function in MAIN:
void QueueRxFunction( void *pvParameters )
{
uint8_t rxValue = 0;
portBASE_TYPE xStatus;
for(;;)
{
if( uxQueueMessagesWaiting( isrQueue ) != 0 )
{
//printf("Queue should be emptyn");
}
xStatus = xQueueReceive( isrQueue, &rxValue, rxQueue_RATE );
if( xStatus == pdPASS )
{
printf("Rcvd message from ISR %in", rxValue);
}
}
}
Function in ISR:
void TIM6
DACIRQHandler(void)
{
long xHigherPriorityTaskWoken = pdFALSE;
if( TIM_GetITStatus(TIM6, TIM_IT_Update) )
{
.
.
.
uint8_t flag = TRUE;
xQueueSendFromISR(isrQueue, &flag, &xHigherPriorityTaskWoken);
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
Thank you for any help on this….(hoping eveyone at the FreeRTOS Support forum has a safe and excellent 2016!)