Code: Select all
#if defined(TIM1)
TIM_TypeDef *Instance = TIM1;
#else
TIM_TypeDef *Instance = TIM2;
#endif
HardwareTimer *MyTim = new HardwareTimer(Instance);
MyTim->setOverflow(100, HERTZ_FORMAT);
MyTim->attachInterrupt(SensorReading);
MyTim->resume();
#if defined(TIM6)
TIM_TypeDef *Instance1 = TIM6;
#else
TIM_TypeDef *Instance1 = TIM7;
#endif
HardwareTimer *MyTim1 = new HardwareTimer(Instance1);
MyTim1->setOverflow(1, HERTZ_FORMAT);
MyTim1->attachInterrupt(LED_ONOFF);
MyTim1->resume();
Thanks for any help.