• AVR Freaks

How to get #define configuration in my MPLAB-X project for all ".c" files ?

Author
Emcy
Super Member
  • Total Posts : 570
  • Reward points : 0
  • Joined: 2008/01/09 03:37:06
  • Location: 0
  • Status: offline
2020/11/25 07:53:27 (permalink)
0

How to get #define configuration in my MPLAB-X project for all ".c" files ?

Hello,
I would like to know if it is possible for all ".c" files to create un text file which enumerate all active #define.

For exemple, my project files  :
 

 
 
 
// file foo1.h
#define FUNC1
#define FUNC2


// file foo2.h
#include "foo1.h"

#ifdef FUNC1
    #define FUNC2_1
#else
    #define FUNC2_1
#endif


// file foo.c
#include "foo2.h"
 
 
 


I would like :

 
 
 
// file foo.txt
#define FUNC1
#define FUNC2
#define FUNC2_1
 
 
 


It is to check #define delaration for ".c" files of my project.


 
post edited by Emcy - 2020/11/25 07:55:47
#1

1 Reply Related Threads

    BroadwellConsultingInc
    Super Member
    • Total Posts : 97
    • Reward points : 0
    • Joined: 2020/06/09 06:07:55
    • Location: 0
    • Status: offline
    Re: How to get #define configuration in my MPLAB-X project for all ".c" files ? 2020/11/25 08:38:46 (permalink)
    +1 (1)
    You can define items one at a time  by adding compiler options under the compiler settings of project options (In my example this is equivalent to #define I2CWOMBAT in every file):
     Attachments are not available: Download requirements not met
     
    Some compilers (such as gcc) also allow you to create an entire .h file full of #defines and have it included as the first file in every file by adding it to the compiler command line with -include myfile.h but this doesn't seem to be supported with XC8.  Not sure about XC16 or 32.

    Attachment(s)

    Attachments are not available: Download requirements not met
    #2
    Jump to:
    © 2021 APG vNext Commercial Version 4.5