Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arduino Due and compil switch __SAM__ (Read 2052 times)
Fabien35
Newbies
*
Offline


Posts: 6
Joined: Jul 21st, 2014
Arduino Due and compil switch __SAM__
Jul 22nd, 2014 at 2:08pm
Print Post  
Hello,

the compilation constant __SAM__ seems to be used when looking to project properties (compilation linformation).

But when trying to use it in my code, the code between the ifdef __SAM__ is not executed (build). The other switch __SAM3X8E__ is working.

But i would like to prefer use the switch familly __SAM__, as i am using already the __AVR__.

Why this switch is define in project properties (by default in the gcc command line), but not really used at build time ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Arduino Due and compil switch __SAM__
Reply #1 - Jul 22nd, 2014 at 10:10pm
Print Post  
Hi Fabien,

To ensure Arduino Ide compatibility Visual Micro reads all build properties from the Arduino IDE configuration.

The definition you are seeing in VS is included by Visual Micro purely to force the vs intellisense to show correctly. (The vsarduino.h file is not included in any of the build process)

Visual Micro attempts to standardize as much code as possible and the vm function that generates __AVR__ also generates __SAM__ for the intellisense system for SAM boards. In a way this is an oversight we should probably prevent until it is implemented by Arduino

These #defines, if available, are part of the underlying board core/toolchain installed with the Arduino IDE and not declared directly by the Arduino IDE itself.

Visual Micro allows you to add your own compiler defines, but this would mean your sketches would not compile correctly in the Arduino IDE. 

You can specify #defines that are passed to the compiler in the Visual Micro project properties. 

Defines - Project
Defines - Configuration

http://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-Reference...
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint