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 #ifdef defined(ARDUINO_AVR_UNO) in VS2017 (Read 1886 times)
Madmax
Newbies
*
Offline


Posts: 2
Location: USA
Joined: Jan 15th, 2019
#ifdef defined(ARDUINO_AVR_UNO) in VS2017
Jan 18th, 2019 at 1:44pm
Print Post  
I am having trouble with the UNO being recognized when using an ifdef statement.

I monitored the xxx.vsauduino.h file to get the values listed below.

Compilation works as expected for all the types listed except for the UNO.  I had to add the else statement in order to get it to work when selecting Arduino/Genuino Uno.

Any suggestions would be greatly appreciated.

jrg

Code (C++)
Select All
#ifdef defined(ARDUINO_AVR_UNO)
	constexpr auto DATA_PIN = 11;
	constexpr auto CLOCK_PIN = 13;
#elif defined(ARDUINO_ESP8266_WEMOS_D1MINI)
	constexpr auto DATA_PIN = 13;
	constexpr auto CLOCK_PIN = 14;
#elif defined(ARDUINO_ESP8266_WEMOS_D1R1)
	constexpr auto DATA_PIN = 13;
	constexpr auto CLOCK_PIN = 14;
#elif defined(ARDUINO_AVR_PRO)
	constexpr auto DATA_PIN = 11;
	constexpr auto CLOCK_PIN = 13;
#elif defined(TEENSYDUINO)
	constexpr auto DATA_PIN = 11;
	constexpr auto CLOCK_PIN = 13;
#else
	constexpr auto DATA_PIN = 11;
	constexpr auto CLOCK_PIN = 13;
#endif 

  
Back to top
 
IP Logged
 
Jo Sto
Ex Member
*


Re: #ifdef defined(ARDUINO_AVR_UNO) in VS2017
Reply #1 - Jan 18th, 2019 at 6:18pm
Print Post  
I think, you should delete "defined" after #ifdef, #elif etc
https://en.cppreference.com/w/cpp/preprocessor/conditional
  
Back to top
 
IP Logged
 
Madmax
Newbies
*
Offline


Posts: 2
Location: USA
Joined: Jan 15th, 2019
Re: #ifdef defined(ARDUINO_AVR_UNO) in VS2017
Reply #2 - Jan 31st, 2019 at 8:23pm
Print Post  
Thanks!  That did it.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint