jradoslav wrote on Tuesday, November 25, 2014:
Dear FreeRTOS developers
I have questions about event creation/memory management in ISR subroutines.
I need to create memory block(Event) in ISR and then send event pointer it to queue.
before i have written this:
ISR()
{
Event* e = pvPortmalloc();
fillEvent(e,&ISRData);
sendQueueFromISR(queue,e);
}
then I`ve read some docs that memory allocation in ISR is not good choice.
this code block seems to be better:
ISR()
{
Event* e;
if(receiveFromISR(freeMemEventQ,&e))
{
sendMemoryRequirementForNextEvent(); -- requirements queue which process other mem generator task
fillEvent(e,&ISRData);
sendQueueFromISR(queue,e);
}
}
My questions are:
1 How many calls *****FromISR routines can be used in ISR?
2 how much ticks consume *****FromISR, I`m using onlu sizeof(pointer) items
3 How can i use higher priority context switching (portYIELD) with more then 1 FromISR call in ISR subroutine.
4 how can i use higherPriorityWoken variable with more then 1 FromISR call in ISR subroutine.
5 portYIELD can be used only at end of ISR subroutine ?
6 How most time-ticks can consume ISR subroutine for safe FreeRTOS running
7 it is absolutely impossible to use malloc in ISR without memory generator task?
ISR
{
BaseType_t hpw1=false,hpw2=false;
FromISR(q,data,&hpw1);
FromISR(q,data,&hpw2);
portYIELDFromISR(hpw1|hpw2);
}
OR
ISR
{
BaseType_t hpw1;
FromISR(q,data,&hpw1);
//hpw1 = true
FromISR(q,data,&hpw2);
//hpw2 = false
portYIELDFromISR( what? );
}
Thank you