Hi.
/*
* ======== main ========
*/
void main() {
LOG_printf(&trace,"Start of semaphore. \n");
printf("Preview Application\n");
fflush(stdout);
return;
}
void initTSK() // Priority 15.
{
// Init queue.
}
void uartTSK(void) // Priority 1.
{
while(1)
{
msg = QUE_get(&freequeue);
// DO something with msg.
QUE_put(&queue,msg);
SEM_post(&sem);
}
}
void SomeTask(void) // Priority 2.
{
// Some commands that uses interrupt or dma.
while(1)
{
SEM_pend(&sem,SYS_FOREVER);
if(QUE_empty(&queue))
{
LOG_printf(&trace,"Empty free queue!\n");
SYS_abort("Empty free queue!\n");
}
msg = QUE_get(&queue);
// Here some manipulation with msg.
QUE_put(&freequeue,msg);
}
}
This programm works fine , It switches between 2 tasks and moves data from void uartTSK(void) to void SomeTask(void) .
However if I enable the line // Some commands that uses interrupt or dma.
in void SomeTask(void) , then the programm is stuck.
Please Advise.