I have a Hologram Dash processor (ARM) that I'm trying to program within VS2015/VM 1705.8.0, Arduino IDE 1.8.2.
Although I can get projects to compile in both the Arduino IDE and VS, the Intellisense in VS is messed up when I select the Dash in my boards dropdown.
In particular, when using uint32_t, Intellisense properly recognizes it for "Arduino Uno" boards, but not for "Dash".
As far as I can tell, I seem to be missing a #define in .<project>.vsarduino.h- maybe!
The following code snippets follow the definitions of int32_t and uint32_t from .intelli.vsarduino.h through _default_types.h, stdint.h, and finally into my main intelli.ino file:
//From .intelli.vsarduino.h:
#define __INTPTR_TYPE__ long
#define __INT32_TYPE__ long
#define _Pragma(x) pragma
//from _default_types.h:
#ifdef __INT32_TYPE__
typedef __INT32_TYPE__ __int32_t;
typedef __UINT32_TYPE__ __uint32_t;
#define ___int32_t_defined 1
//from stdint.h:
#ifdef ___int32_t_defined
typedef __int32_t int32_t ;
typedef __uint32_t uint32_t ;
#define __int32_t_defined 1
#endif
//from intelli.ino:
uint32_t ux;
int32_t x;
void setup()
{
/* add setup code here */
Serial.begin(9600);
}
The __UINT32_TYPE__ in _default_types.h shows as undefined, which causes the rest of the following definitions to fail- but again, only in IntelliSense, not during actual compile.
If I add the line
#define __UINT32_TYPE__ unsigned long //MISSING IN AUTOGENERATED FILE
to .intelli.vsarduino.h, the typedefs in _default_types.h and stdint.h now show correct IntelliSense information, but my uint32_t variable declaration in intelli.ino is still not showing correctly in IntelliSense. It compiles correctly, but I think the vsarduino file gets regenerated before the compile, so I can't tell whether that would break the build or not.
I have many questions LOL but I guess two two biggest are:
- How does vsarduino.h get generated? Is there a "template" that I can modify?
- How is it that the uint32_t declaration in my ino file still doesn't recognize the definition via IntelliSense, whereas the int32_t declaration works just fine? Is this a bug in VS IntelliSense? Bad configuration on my part?
Sorry for the long-winded post, but I figure it's best to present as much (hopefully relevant!) information as I can up front.