• AVR Freaks

Hot!advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and has b

Author
akibsk
New Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2018/10/30 07:07:04
  • Location: 0
  • Status: offline
2018/10/30 08:03:35 (permalink)
0

advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and has b

HI,
Why this error with 18f2520 in xc8 "advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and has been duplicated by the compiler" can it be affected in operation of hardware.
the con fig. was as below:
""
/* test 18f2520 */
//CONFIG1H
#pragma config OSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
#pragma config IESO = OFF // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
// CONFIG2L
#pragma config PWRT = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = SBORDIS // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled))
#pragma config BORV = 3 // Brown Out Reset Voltage bits (Minimum setting)
// CONFIG2H
#pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
#pragma config WDTPS = 32768 // Watchdog Timer Postscale Select bits (1:32768)
// CONFIG3H
#pragma config CCP2MX = PORTC // CCP2 MUX bit (CCP2 input/output is multiplexed with RC1)
#pragma config PBADEN = OFF // PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
#pragma config LPT1OSC = OFF // Low-Power Timer1 Oscillator Enable bit (Timer1 configured for higher power operation)
#pragma config MCLRE = ON // MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
// CONFIG4L
#pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config LVP = OFF // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
#pragma config XINST = OFF // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
// CONFIG5L
#pragma config CP0 = OFF // Code Protection bit (Block 0 (000800-001FFFh) not code-protected)
#pragma config CP1 = OFF // Code Protection bit (Block 1 (002000-003FFFh) not code-protected)
#pragma config CP2 = OFF // Code Protection bit (Block 2 (004000-005FFFh) not code-protected)
#pragma config CP3 = OFF // Code Protection bit (Block 3 (006000-007FFFh) not code-protected)
// CONFIG5H
#pragma config CPB = OFF // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected)
#pragma config CPD = OFF // Data EEPROM Code Protection bit (Data EEPROM not code-protected)
// CONFIG6L
#pragma config WRT0 = OFF // Write Protection bit (Block 0 (000800-001FFFh) not write-protected)
#pragma config WRT1 = OFF // Write Protection bit (Block 1 (002000-003FFFh) not write-protected)
#pragma config WRT2 = OFF // Write Protection bit (Block 2 (004000-005FFFh) not write-protected)
#pragma config WRT3 = OFF // Write Protection bit (Block 3 (006000-007FFFh) not write-protected)
// CONFIG6H
#pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
#pragma config WRTB = OFF // Boot Block Write Protection bit (Boot block (000000-0007FFh) not write-protected)
#pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM not write-protected)
// CONFIG7L
#pragma config EBTR0 = OFF // Table Read Protection bit (Block 0 (000800-001FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR1 = OFF // Table Read Protection bit (Block 1 (002000-003FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR2 = OFF // Table Read Protection bit (Block 2 (004000-005FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR3 = OFF // Table Read Protection bit (Block 3 (006000-007FFFh) not protected from table reads executed in other blocks)
// CONFIG7H
#pragma config EBTRB = OFF // Boot Block Table Read Protection bit (Boot block (000000-0007FFh) not protected from table reads executed in other blocks)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>
#define _XTAL_FREQ 20000000
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void delay(int time)
{
for(int i=0;i<time;i++)
for(int j=0;j<800;j++);
}
""
request reply please.
tnx
#1

9 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 08:04:51 (permalink)
    +1 (1)
    It would make your post easier to read if you used code tags as Ian explains in this post https://www.microchip.com..ums/m777101.aspx#777101
    #2
    btbass
    Super Member
    • Total Posts : 359
    • Reward points : 0
    • Joined: 2004/12/10 13:50:32
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 08:22:07 (permalink)
    0
    It would appear that you are calling your delay function from your program and also from an interrupt.
    The function is non re entrant, so it can not be interrupted while it is executing.
     
    The compiler has created two instances of the function, so the interrupt call and the program call each have their own implementation.
    #3
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3233
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 08:42:50 (permalink)
    0
    Can you show your interrupt code?

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 17723
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 09:03:19 (permalink)
    +2 (2)
    This is not an error. It is an informational message. You can ignore it if you are ok with it.
    And you know the compiler has built in delay functions.
    #5
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11288
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 11:01:15 (permalink)
    +2 (2)
    Don't make your own delay function, use the compiler's delay functions.
     
    And delays in an interrupt most likely defeats the point of an interrupt.
    #6
    akibsk
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2018/10/30 07:07:04
    • Location: 0
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 11:20:35 (permalink)
    0
    "Can you show your interrupt code?"
     
    void interrupt isr()
    {
    if(INT0IF)
    {

    //INT0IF=0;
    delay(speed);
    tric=1;
    __delay_us(30);
    tric=0;
    INT0IF=0;
    }

    if(TMR0IF) 
    {
    TMR0IF=0;
    }

    }
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 11:25:55 (permalink)
    +1 (1)
    akibsk,
    code tags make your code easier to read for other forum users.
    #8
    Aussie Susan
    Super Member
    • Total Posts : 3612
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 18:12:18 (permalink)
    +2 (2)
    It is a bad idea to put delays into an ISR.
    An ISR should execute a quickly as possible and then finish so the main code can run.
    In this case you should use the ISR to set a flag then implement the pulse of the 'tric' variable in the main code if the flag is set.
    Susan
    #9
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3233
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: advisory: (1510) non-reentrant function "_delay" appears in multiple call graphs and h 2018/10/30 18:38:29 (permalink)
    +1 (1)
    What Susan said.
    Short interrupts and use timers for delays.
    You can either check the timer flag or interrupt.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #10
    Jump to:
    © 2019 APG vNext Commercial Version 4.5