Hi i am trying to figure out how the timers work on this but there doesn't appear to be any docs yet which makes it hard to figure out what i am supposed to do. if there are please send them. so i tried this but this just seems to print the same value.
what i want to do is basicly trigger a interrupt on a certain interval to allow me to just check something and update some values.
and i am trying to avoid having to install Librarys so if possible don't use them.
if you have questions please ask away.
i have some experience with STM32's timer system and how that works.
#include <FspTimer.h>
FspTimer Timer;
void IRQ_HIT(timer_callback_args_t *p_args) {
static bool status = false;
digitalWrite(LED_BUILTIN, status);
status = !status;
}
void setup() {
Serial.begin(115200);
delay(500);
pinMode(LED_BUILTIN, OUTPUT);
uint8_t timerType = GPT_TIMER;
int8_t channel = FspTimer::get_available_timer(timerType);
if (channel < 0) {
Serial.println("No free GPT timer available");
while (1);
}
Serial.println(channel);
bool ok = Timer.begin(
TIMER_MODE_PERIODIC,
GPT_TIMER,
channel,
1000.0,
100.0,
&IRQ_HIT
);
if (!ok) {
Serial.println("Timer init failed");
while (1);
}
Serial.println("Timer initialized!");
Timer.start();
}
void loop() {
Serial.println(Timer.get_counter());
delay(500);
}