Pits * * * WARNING l15:multiple call to SEGMENT
Warning: A re-entry has occurred !
Explanation: A function was called in the main loop, and the same function was called again in the interrupt service. When the main loop runs into the function, once the interrupt is generated, the function is called again in the interrupt, causing the child function to be re-entered. At this point, although the probability is very low , but it is possible to make a mistake! In this way , the compiler gives a warning -a re-entry has occurred !
may cause procedural conflicts, assuming that you are using the Automation field, it can cause spikes in the signal. The way to avoid this is to call the function's flag at the time of the break, and call the function in the main loop。
a . with reentrantTo re-enter the function
1. The reentrant function cannot be passedbittypes of parameters and variables;
2. The Reentrant function establishes an analog stack area, so instead of using a generic function in the overlay stack of the storage mode default space, a non-overlay re-entry stack is allocated from the top in the same space.
Small default space isdata;
CompactThe default space ispdata;
Large default space isXData;
3. Because of the need to save parameters and local variables, so it will consume a lot of stack space, as far as possible to use this mode;
4. In the same program can be defined and use a different memory mode of the Reentrant function, arbitrary mode of the reentrant function can not call the different memory mode of the Reentrant function, but the normal function may be called.
5. The actual parameters can be passed to the reentrant function of the indirect call. An indirect call function without a reentrant property cannot contain a call parameter.
two . If there is more space, you can define two functions of the same function, respectively, in the interrupt and interrupt
Three . The main program disables interrupts when it calls the function.
You can use the #pragma disable statement for the purpose of prohibiting interrupts when the function is called.
You must use the OVERLAY directive to remove the function from the overlay analysis.
You can also use ea=1,ea=0 to switch interrupts.
Pits * * * WARNING l15:multiple call to SEGMENT