WARNING L15: multiple call to segment, l15segment
Trap Filling* ** WARNING L15: MULTIPLE CALL TO SEGMENT
Warning re-import occurred!
Explanation: a function is called in the main loop, and the same function is called again in the interrupted service. When the main loop runs to this function, once an interruption occurs, the function is called again during the interruption, causing the sub-function to be reloaded. At this time, although the probability is very low, it is very likely to make an error! In this way, the compiler gives a warning-a re-entry occurred!
It may cause program conflicts. If you are used in the automation field, it may lead to signal spikes. To avoid this problem, set the flag for calling the function when the function is interrupted, and call the function in the main loop.
I. UseReentrantRe-import function
1. The re-entry function cannot pass parameters and variables of the bit type;
2. the re-entry function is used to create a simulated stack area. Therefore, the general function is not used to store the overwritable stack in the default storage space, instead, a non-overwriting re-entry stack is allocated from the top of the same space.
The default space for small is data;
The default compact space is pdata;
Large's default space is xdata;
3. Because you want to save parameters and local variables, it will consume a lot of stack space; use this mode as little as possible;
4. In the same program, you can define and use the re-entry functions of different memory modes. The re-entry functions of any mode cannot call the re-entry functions of different memory modes, but can call common functions.
5. The actual parameters can be passed to the indirectly called re-input function. Indirect call functions of the non-reentrant attribute cannot contain call parameters.
2. If there is a lot of space, you can define two functions with the same function and call them out of the interrupt and the interrupt respectively.
3. interruption is prohibited when the main program calls this function.
The # pragma disable statement can be used when the function is called to prevent interruption.
The OVERLAY command must be used to remove the function from overwrite analysis.
You can also use EA = 1, EA = 0 to switch the interrupt.