Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Intellisense autogen fails to include definitions for PORTA #1529

Open
BjornMoren opened this issue Aug 28, 2022 · 5 comments
Open

Intellisense autogen fails to include definitions for PORTA #1529

BjornMoren opened this issue Aug 28, 2022 · 5 comments

Comments

@BjornMoren
Copy link

It seems like the intellisense autogen that inserts items into the defines list in c_cpp_properties.json is not working properly.

My project compiles fine, but I get intellisense warnings in my Ardunio code that PORTA is undefined.

If I manually add "AVR_ATmega328P" to the defines list in c_cpp_properties.json then intellisense works fine.

@github-actions github-actions bot added the triage New issues that have not been reviewed. label Aug 28, 2022
@benmcmorran
Copy link
Member

Thanks for the report. To help us reproduce the issue, can you provide a sample .ino file that reproduces the issue and tell us which board you are targeting? You can find the board in the .vscode/arduino.json file.

@benmcmorran benmcmorran added needs-more-info More details about this issue are needed for it to be actionable. and removed triage New issues that have not been reviewed. labels Sep 2, 2022
@BjornMoren
Copy link
Author

BjornMoren commented Sep 3, 2022

From arduino.json:
"board": "arduino:avr:uno"

Project.ino has no issues, uses the following includes:

#include <Arduino.h>
#include "ScreenLCD.h"
#include "DateTime.h"

#if ENABLE_SENSORS == 1
#include <Wire.h>
#endif

#if ENABLE_SD_CARD == 1
#include <SPI.h>
#include "SdFat.h"
#endif

The ScreenLCD.cpp has the intellisense issues, here are the relevant parts:

#include "ScreenLCD.h"
#ifdef __AVR__
  #include <avr/pgmspace.h>
#elif defined(ESP8266) || defined(ESP32)
  #include <pgmspace.h>
#endif

void ScreenLCD::_writeCommandData8(uint8_t reg, uint8_t data)
{
	PORTA = 0; <-- Intellisense complains about PORTA
}

Here is the beginning of the defines section of the c_cpp_properties.json file:

   "defines": [
                "F_CPU=16000000L",
                "ARDUINO=10816",
                "ARDUINO_AVR_UNO",
                "ARDUINO_ARCH_AVR",
                "__AVR_ATmega328P__",        <-- This one I have to manually add myself, and then turn off autogen
                "__DBL_MIN_EXP__=(-125)",

@github-actions
Copy link

github-actions bot commented Oct 3, 2022

This issue has been automatically marked as stale because it has been inactive for 30 days. To reactivate the issue, simply post a comment with the requested information to help us diagnose this issue. If this issue remains inactive for another 7 days, it will be automatically closed.

@github-actions github-actions bot added the stale label Oct 3, 2022
@benmcmorran benmcmorran added investigating and removed needs-more-info More details about this issue are needed for it to be actionable. stale labels Oct 4, 2022
@0xAl3xH
Copy link

0xAl3xH commented Nov 21, 2022

Still running into this issue, related to #1279

@StefanKellerAC
Copy link

maybe it is related to #1354 (comment) in the Pico core.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants