https://www.arduino.cc/en/software
Apparently, it is working quite well now but that is just initial impressions, have not tried debug etc.
One of the features reference jumps for symbols, works to an extent but imperfect.
for some of the symbols, you can right click select Goto Definition and it would open the include / definition in a new tab.
It is one of the 'missing' features, which accordingly is provided by the clangd https://clangd.llvm.org/.
Some of the reference jumps don't work, but it compiles fine.
The screen print and console response messages is a 'blinky' app, which prints something to usb serial periodically.
it is more of a lousy 'breathing' led test. the sample sketch:
Code: Select all
#include <Arduino.h>
#include <HardwareTimer.h>
HardwareTimer *pTimer2 = new HardwareTimer(TIM2);
int16_t count;
int8_t dir;
bool pr = false;
void ledon() {
int8_t channel = 1;
digitalWrite(LED_BUILTIN, LOW);
if(count > 100) {
dir = -1;
count = 100;
} else if (count < 1) {
dir = 1;
count = 1;
pr = true;
}
pTimer2->setCaptureCompare(channel, count, PERCENT_COMPARE_FORMAT); // count here is the duty cycle 1-100
}
void ledoff() {
digitalWrite(LED_BUILTIN, HIGH);
count += dir;
}
void setup() {
count = 0;
dir = 1;
Serial.begin();
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
uint8_t channel = 1;
pTimer2->pause(); // pause the timer
pTimer2->setMode(channel, TIMER_OUTPUT_COMPARE_PWM1); //output compare mode, got this from reading the api notes
pTimer2->setOverflow(50, HERTZ_FORMAT); // call back at 50 hz
pTimer2->attachInterrupt(ledon); // attach ledon() every cycle turn on the led
pTimer2->attachInterrupt(channel, ledoff); // attach ledoff() end of duty cycle turn off the led
pTimer2->refresh(); //reset the counters
pTimer2->resume();
}
void loop() {
if(pr) {
Serial.println("hello stm32");
pr = false;
}
delay(1000);
}