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
Hot Topic (More than 8 Replies) Intellisense define for __arm__ (lower case) missing for Teensy 3.x (Read 8268 times)
Markk
Junior Member
**
Offline


Posts: 15
Joined: Oct 9th, 2014
Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Nov 15th, 2015 at 3:24pm
Print Post  
Hi

first let me thank you for a great product! 

In release notes (1510.12) you wrote:

Quote:
Added intellisense define for  __AVR__ or __ARM__ depending on hardware. (fixes intellisense problems with libraries such as TimerOne)


There seems to be a lower case __arm__ define too for Teensy 3.x which is extensively used by its official [remplacement] libraries. See SD.h for an example. 

It would be nice to have this define too. 

Thank you very much. 

-Mark

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12072
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #1 - Nov 15th, 2015 at 4:44pm
Print Post  
Thanks for the post. I have updated the intellisense for the next release. 

You can make the same change if you like. You can find the visual micro install location in tools>options>visual micro>version>assembly.

Then you can add the #define to

[visual micro install location]\Micro Platforms\arduino16x\hardware\teensy3\intellisense.code.h

The file is used to create the __vm\.projname_vsarduino.h for each project which is only used to help intellisense and not compile.

If you find any other defines or better alternatives I will appreciate a note.

Thanks
  
Back to top
WWW  
IP Logged
 
Markk
Junior Member
**
Offline


Posts: 15
Joined: Oct 9th, 2014
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #2 - Nov 16th, 2015 at 8:20am
Print Post  
Thank you for your fast answer.

However the workaround does not work Sad

This is the changed intellisense.code.h:

Code (C++)
Select All
#define __ARM__
#define __arm__
#define __extension__
#define  __attribute__(x)
typedef void *__builtin_va_list;

#define __extension__
#define __ATTR_PURE__
#define __ATTR_CONST__
#define __inline__
#define __asm__
#define __volatile__

#define NEW_H
 



This is the generated .projname_vsarduino.h (I don't find the intellisense.code.h contents in there and as expected it does not work for intellisense i.e. the wrong #ifdefs are grayed out):

Code (C++)
Select All
/*
	Editor: http://www.visualmicro.com
	        visual micro and the arduino ide ignore this code during compilation. this code is automatically maintained by visualmicro, manual changes to this file will be overwritten
	        the contents of the Visual Micro sketch sub folder can be deleted prior to publishing a project
	        all non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!).
	        note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again

	Hardware: Teensy 3.1, Platform=avr, Package=teensy
*/

#ifndef _VSARDUINO_H_
#define _VSARDUINO_H_
#define __MK20DX256__
#define TEENSYDUINO 124
#define ARDUINO 165
#define F_CPU 24000000
#define ARDUINO_ARCH_AVR
#define USB_SERIAL
#define LAYOUT_US_ENGLISH
#define __cplusplus
#define __AVR__
#define __inline__
#define __asm__(x)
#define __extension__
//#define __ATTR_PURE__
//#define __ATTR_CONST__
#define __inline__
//#define __asm__
#define __volatile__
#define GCC_VERSION 40801
#define volatile(va_arg)
#define _CONST
typedef void *__builtin_va_list;
#define __builtin_va_start
#define __builtin_va_end
//#define __DOXYGEN__
#define __attribute__(x)
#define NOINLINE __attribute__((noinline))
#define prog_void
#define PGM_VOID_P int
#ifndef __builtin_constant_p
#define __builtin_constant_p __attribute__((__const__))
#endif
#ifndef __builtin_strlen
#define __builtin_strlen  __attribute__((__const__))
#endif
#define NEW_H
/*
#ifndef __ATTR_CONST__
#define __ATTR_CONST__ __attribute__((__const__))
#endif

#ifndef __ATTR_MALLOC__
#define __ATTR_MALLOC__ __attribute__((__malloc__))
#endif

#ifndef __ATTR_NORETURN__
#define __ATTR_NORETURN__ __attribute__((__noreturn__))
#endif

#ifndef __ATTR_PURE__
#define __ATTR_PURE__ __attribute__((__pure__))
#endif            
*/
typedef unsigned char byte;
extern "C" void __cxa_pure_virtual() {;}



#include <arduino.h>
#undef F
#define F(string_literal) ((const PROGMEM char *)(string_literal))
#undef PSTR
#define PSTR(string_literal) ((const PROGMEM char *)(string_literal))
#undef cli
#define cli()
#define pgm_read_byte(address_short)
#define pgm_read_word(address_short)
#define pgm_read_word2(address_short)
#define digitalPinToPort(P)
#define digitalPinToBitMask(P)
#define digitalPinToTimer(P)
#define analogInPinToBit(P)
#define portOutputRegister(P)
#define portInputRegister(P)
#define portModeRegister(P)
...
#endif
 



If this is just a problem of the workaround and not the release then just ignore this... I can wait.

Thanks again.

-Mark
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12072
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #3 - Nov 16th, 2015 at 1:57pm
Print Post  
Hi,

If you switch to a different board in the list then back again is the intellisense refreshed?
  
Back to top
WWW  
IP Logged
 
Markk
Junior Member
**
Offline


Posts: 15
Joined: Oct 9th, 2014
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #4 - Nov 16th, 2015 at 2:08pm
Print Post  
No, I'm afraid, I tried that. 

Also I tried different insertion points in the intellisense.code.h with no success. 

Please note that the .projname_vsarduino.h does not seem to contain the intellisense.code.h contents in any comprehensible way.

Thanks again,
-Mark

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12072
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #5 - Nov 16th, 2015 at 2:09pm
Print Post  
Okay thanks I will investigate
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12072
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #6 - Nov 16th, 2015 at 8:02pm
Print Post  
Q's

Which arduino ide are you using for teensyduino? or please give the download url for teensyduino?

What is the name of the application you have configured in visual micro for the teensyduino install?

Thanks
  
Back to top
WWW  
IP Logged
 
Markk
Junior Member
**
Offline


Posts: 15
Joined: Oct 9th, 2014
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #7 - Nov 17th, 2015 at 8:17am
Print Post  
Hi

I'm using arduino 1.6.5-r2 and teensyduino 1.24-beta3. I can upgrade to the latest if that helps.

I don't recall having configured an application name. I think it automatically added "Arduino 1.6" when I installed the addin.

_m
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12072
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #8 - Nov 22nd, 2015 at 2:36am
Print Post  
Hi,

I found that all intellisense failed for teensy3 because all teensy boards pretend to be avr and not arm. The reason is a weakness in the arduino ide library resolver which I think might have recently been plugged so we should see a change in the teensy config sometime soon. 

For now a new config setting has been implemented which forces visual micro to use the boards.txt>build.core to distinguish between the real architectures.

With the latest release of Visual Micro (1511.21) I  hope the Errors List will show "0 Errors"

Thanks for the report. 32 bit Teensy intellisense in Arduino 1.6.2+ was certainly broke!
  
Back to top
WWW  
IP Logged
 
Markk
Junior Member
**
Offline


Posts: 15
Joined: Oct 9th, 2014
Re: Intellisense define for __arm__ (lower case) missing for Teensy 3.x
Reply #9 - Nov 22nd, 2015 at 8:47pm
Print Post  
Hi

Wow! I can confirm it works flawlessly.

Thank you very much,
Markk
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint