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 wrong use of CAPS in ATtiny MCU definitions? (Read 4300 times)
Genoil
Newbies
*
Offline


Posts: 6
Joined: Sep 16th, 2013
wrong use of CAPS in ATtiny MCU definitions?
Sep 20th, 2013 at 8:38am
Print Post  
I'm using the tiny core for Arduino and noticed the following. In the .$projectName.vsarduino.h, the MCU gets defined in all caps:

Code
Select All
//Board = ATtiny84 @ 8 MHz  (internal oscillator; BOD disabled)
#define __AVR_ATTINY84__
 



while in the attiny core files, checks are always done on
Code
Select All
__AVR_ATtiny84__
 



The code highlighting seems to respond to the all caps definition, while during compilation, it actually responds to the mixed caps definition. So now I have to: 

Code
Select All
#if(defined(__AVR_ATTINY84__) || defined(__AVR_ATtiny84__))
 



To have both correct highlighting and compilation. Can this be fixed?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: wrong use of CAPS in ATtiny MCU definitions?
Reply #1 - Sep 20th, 2013 at 12:00pm
Print Post  
Thanks for pointing out this intellisense issue.

Another short term solution might be to add the correct define to project properties "Defines - Project"

I hope this does not cause an "Already defined" error during compilation. If this works then you will not need to alter your code.

Alternatively define the uppercase version at the top of the code using the correct format. This will be easier to remove from the code later on.

Just some ideas that I hope will help. We will fix this in the next release.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: wrong use of CAPS in ATtiny MCU definitions?
Reply #2 - Dec 18th, 2013 at 9:22pm
Print Post  
This is fixed in the next release but you can apply a short term fix yourself by adding __AVR_ATtiny84__ to the "Micro General>Defines - Project" project property. (you will find the property in F4/Properties Window when on the project in VS). 

You can also use the Defines - Configuration Property if working with more than one type of board for a single project but I know not many people will work this way.

If you need to add other defines for your own project they can all be appended to the property using a ;

Example

Code
Select All
__AVR_ATtiny84__;foo1=10;foo2 


  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint