WARNING L15: multiple call to segment, l15segment

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.