OS Versison: MacOS High Sierra 10.13.6 Other Extensiosns
C++: 0.19.0
Cortex-Debug: 0.1.21
Particle Code Snippets: 1.0.0-alpha.3
Particle Themes: 1.0.0-alpha.3
Particle Workbench 1.0.0-alpha.3
Existing codebase uses “retained” variable declarations with no issues and builds/runs correctly under ParticleDev/Atom environment. Under VSCode environment, codebase builds, flashes and runs correctly. However in the Particle Workbench “Problems” tab, reports “this declaration has no storage class or type specifier” for all “retained” declared variables. Similar problem for “time_t” reports “not a type name”.
/*
* Project testvs
* Description:
* Author:
* Date:
*/
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));
retained int test;
// setup() runs once, when the device is first turned on.
void setup() {
// Put initialization like pinMode and begin functions here.
}
// loop() runs over and over again, as quickly as it can execute.
void loop() {
// The core of your code will likely live here.
}
Compiles with no problem, just VS complains about retained and the variable it describes.