Maybe this should be in another thread. I have been using visual Micro with Visual Studio 2015 for some time but saw there was an update so I have installed Visual Studio 2019 version 16.0.2 with Visual Micro 1904.20.1 and the Arduino IDE 1.8.9 but now I am having a few problems with a project which built OK in the old setup.
I am experimenting with an ATTiny841 using the library from SpenceKonde/ATTinyCore.
https://github.com/SpenceKonde/ATTinyCore. ;
I downloaded the zipped library file and un-zipped it to C:\Users\james\Documents\Arduino\Hardware\ATTinyCore.
The problem I have is when I now open the project in the new installation, and start typing in say DDR for DDRA I dont get intellisense suggestions, also Intellisense highlights a number of errors in the code but the project seems to Builds OK and runs when downloaded to my board.
What you cant see in the attached code is that PIN_B0, PINB0 etc and all references to the processors registers like DDRB, UBRR0H etc have the red squigly intellisense warning under them with "Potential fixes". If I look at the "potential fixes" I get a huge list of #include suggestions.
const byte IndicatorLedRed = PIN_B0;
const byte IndicatorLedRedRegPos = PINB0;
const byte IndicatorLedGreen = PIN_B1;
const byte IndicatorLedGreenRegPos = PINB1;
byte MainLoopCount;
void setup()
{
DDRB = DDRB | (1 << IndicatorLedRedRegPos) | (1 << IndicatorLedGreenRegPos);
USART0_Init(25);
}
void loop(void)
{
MainLoopCount = 1;
while (MainLoopCount)
{
digitalWrite(IndicatorLedGreen, HIGH);
delay(2000);
digitalWrite(IndicatorLedGreen, LOW);
delay(200);
digitalWrite(IndicatorLedRed, HIGH);
delay(2000);
digitalWrite(IndicatorLedRed, LOW);
delay(200);
--MainLoopCount;
}
USART0_Transmit(char('5'));
}
void USART0_Init(unsigned int baud)
{
UBRR0H = (unsigned char)(baud >> 8);
UBRR0L = (unsigned char)baud;
UCSR0B = (1 << TXEN0);
UCSR0C = (1 << USBS0) | (3 << UCSZ00);
}
void USART0_Transmit(unsigned char data)
{
while (!(UCSR0A & (1 << UDRE0)));
UDR0 = (data);
}
Any ideas, probably something silly I have done.
Jim