Hii ,
I designed a TaskScheduler consisting of 3 tasks of which one is TaskIdle().
For time being,I am using Timer Interrupts for producing a maskable interrupt(INT4).
After executing Task1,TaskIdle will run during which interrupts occur.Interrupts are serviced using an ISR during which PGIE = 1 and GIE = 0.Samples are demodulated during each interrupt.I have 1152 samples to demodulate.
When interrupt is serviced and TaskIdle is resumed, PGIE = GIE =1..After demodulating 672 samples,I am making Task2 ready through ISR.And when TaskIdle is run,it will check whther any higher priority task is ready to run.And here comes my problem...At this point,the value of GIE is not copied correctly to PGIE,which means PGIE =1 and GIE = 0,which is wrong.
and after this,Task2() will run.Inside TASK2(),PGIE and GIE = 0.But both should be set to 1.Is it because the stack is not being properly loaded and stored?
After executing Task2(),I want interrupts to occur so that I can demodulate rest of the samples.But Interrupts does not occur after that.because GIE and PGIE is 0.
In this case,can I enable GIE to my choice? If so,will it affect scheduling of tasks or other interrupts?
Looking forward for the reply,
Regards,
James