as replied in my opened ticket 25 is not an allowed pin for analogWrite.
Si my problem remain, why doesn't it work in an interrupt?
#include <Portenta_H7_TimerInterrupt.h>
#define LEDB_PIN 3
volatile char val_ledb;
Portenta_H7_Timer ITimer0(TIM1);
void TimerHandler0() {
static bool state = 0;
if(state == true) {
analogWrite(LEDB_PIN, val_ledb);
} else {
analogWrite(LEDB_PIN, 0);
}
state = !state;
}
void setup() {
pinMode(LEDB_PIN, OUTPUT);
val_ledb = 153;
ITimer0.attachInterruptInterval(1000UL * 1000UL, TimerHandler0);
}
void loop() {
}