Is it better to call a function in interrupt routine which has large instructions as given below
Code:
Interrupt_1()
{
Function();
}
Interrupt_2()
{
Func_2();
}
void Function_1()
{
PORTA=0;
PORTB= 0;
Delay_ms(1000);
and further code
}
void Func_2()
{
PORTA=0;
PORTB= 0;
Delay_ms(1000);
and further code
My questions are if interrupt_1() calls function_1()
and is executing(not completed yet) and then interrupt_2 occurs.
1. will it handle interrupt_2 Routine leaving Function_1
2. After calling func_2() Which function will be executed first function_1() or Func_2() by keeping above scenario in mind
Absolutelly, no; Insertion of delays in isr coutines is a bad practice.
I would say that the exact answer for all your questions is core dependent ( how many isr vector available ) and compiler dependent ( there is no instruction on the above code to handle any isr register ).