Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit cc1970f

Browse files
committed
fixed PWM issue
1 parent 8246829 commit cc1970f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void timer_foreach(void (*fn)(timer_dev*)) {
352352
void timer_attach_interrupt(timer_dev *dev,
353353
uint8 interrupt,
354354
voidFuncPtr handler) {
355-
dev->handlers[interrupt] = handler;
355+
dev->handlers[interrupt-1] = handler;
356356
timer_enable_irq(dev, interrupt);
357357
enable_irq(dev, interrupt);
358358
}
@@ -368,7 +368,7 @@ void timer_attach_interrupt(timer_dev *dev,
368368
*/
369369
void timer_detach_interrupt(timer_dev *dev, uint8 interrupt) {
370370
timer_disable_irq(dev, interrupt);
371-
dev->handlers[interrupt] = NULL;
371+
dev->handlers[interrupt-1] = NULL;
372372
}
373373

374374
/*

0 commit comments

Comments
 (0)