Should I disable interrupts in one?

Do I need to disable high interrupts while inside if I use multiple interrupts on the Microchip C18?

Consider the code below:

#ifndef OTHER_INTERRUPT_H #pragma interrupt InterruptHook // interrupt fname void InterruptHook(void) { #ifdef STEPPER_H Stepper_Interrupt(); #endif #ifdef FLOW_H Flow_Interrupt(); #endif } #endif 

Should I follow the same approach as in the code below? (Then I would disable them in the appropriate places inside the functions.)

 #ifndef OTHER_INTERRUPT_H #pragma interrupt InterruptHook // interrupt fname void InterruptHook(void) { #ifdef STEPPER_H INTCONbits.GIEH = 0; Stepper_Interrupt(); INTCONbits.GIEH = 1; #endif #ifdef FLOW_H INTCONbits.GIEH = 0; Flow_Interrupt(); INTCONbits.GIEH = 1; #endif } #endif 
+4
source share
1 answer

It depends on the equipment. Some processors automatically turn off service interrupts. Others prioritize their interrupts, so that a higher priority interrupt can still occur when a smaller one is being serviced.

Microchip PIC18 chips have several levels of hardware interrupts, and they may also be optionally priority ones.

+2
source

Source: https://habr.com/ru/post/1389787/


All Articles