Hot!DEVICE_CONFIG_H

Author
PK DEY
New Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2019/01/20 22:52:04
  • Location: 0
  • Status: offline
2019/02/13 08:08:58 (permalink)
0

DEVICE_CONFIG_H

PIC18F87K22
MCC v1.65.2
MPLAB XC8 Compiler 2.05


When I generate code using MCC it generate a header file called "device_config.h" and the following code is written down on that file. 

#ifndef DEVICE_CONFIG_H
#define DEVICE_CONFIG_H

#define _XTAL_FREQ 8000000

#endif

I don't understand the function of the following statements in the above code! 
#ifndef DEVICE_CONFIG_H
#define DEVICE_CONFIG_H
Could someone please explain the function of the above statement?
post edited by PK DEY - 2019/02/13 08:10:29
#1

4 Replies Related Threads

    1and0
    Access is Denied
    • Total Posts : 8842
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: DEVICE_CONFIG_H 2019/02/13 08:20:50 (permalink)
    #2
    PK DEY
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2019/01/20 22:52:04
    • Location: 0
    • Status: offline
    Re: DEVICE_CONFIG_H 2019/04/16 18:13:24 (permalink)
    0
    #define COUNT 100
    In the above statement "COUNT" constant is defined to a value 100.
    #define DEVICE_CONFIG_H
    BUT in the above statement "DEVICE_CONFIG_H" is defined to what value? Explain please?

    Thanks in Advance?
     
    #3
    pcbbc
    Super Member
    • Total Posts : 786
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: DEVICE_CONFIG_H 2019/04/16 21:21:31 (permalink)
    +2 (2)
    Esentially an empty string. But the point is it is defined.
    Prior to...
    #define DEVICE_CONFIG_H
    ...it was UN-defined.
    #4
    qhb
    Superb Member
    • Total Posts : 9609
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: DEVICE_CONFIG_H 2019/04/17 04:51:39 (permalink)
    +2 (2)
    ... and this matters because it is possible to detect if a label is defined at all using "#ifdef".
     
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5