Commit c6983e3
stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8.
It turns out that TIM1 and TIM8 have their own Capture/Compare
interrupt vector. For all of the other timers, the capture/compare
interrupt vector is the same as the update vector.
So we need to add handlers for these vectors and enable them
when using capture/compare callbacks.
During testing of this, I also found that passing a channel callback
into the channel constructor would not enable interrupts properly.
I tested using:
```
>>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
```
I tested the above with channels 1, 4, and 81 parent f2a21a2 commit c6983e3
2 files changed
Lines changed: 38 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
559 | 565 | | |
560 | 566 | | |
561 | 567 | | |
| |||
581 | 587 | | |
582 | 588 | | |
583 | 589 | | |
| 590 | + | |
584 | 591 | | |
585 | 592 | | |
586 | 593 | | |
587 | 594 | | |
588 | 595 | | |
| 596 | + | |
589 | 597 | | |
| 598 | + | |
590 | 599 | | |
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
594 | 603 | | |
| 604 | + | |
595 | 605 | | |
| 606 | + | |
596 | 607 | | |
597 | 608 | | |
598 | 609 | | |
| |||
614 | 625 | | |
615 | 626 | | |
616 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
617 | 634 | | |
618 | 635 | | |
619 | 636 | | |
620 | 637 | | |
621 | 638 | | |
| 639 | + | |
622 | 640 | | |
623 | 641 | | |
624 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
606 | 613 | | |
607 | 614 | | |
608 | 615 | | |
| |||
932 | 939 | | |
933 | 940 | | |
934 | 941 | | |
935 | | - | |
| 942 | + | |
936 | 943 | | |
937 | 944 | | |
938 | 945 | | |
| |||
970 | 977 | | |
971 | 978 | | |
972 | 979 | | |
973 | | - | |
| 980 | + | |
974 | 981 | | |
975 | 982 | | |
976 | 983 | | |
| |||
997 | 1004 | | |
998 | 1005 | | |
999 | 1006 | | |
1000 | | - | |
| 1007 | + | |
1001 | 1008 | | |
1002 | 1009 | | |
1003 | 1010 | | |
| |||
1294 | 1301 | | |
1295 | 1302 | | |
1296 | 1303 | | |
1297 | | - | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1298 | 1314 | | |
1299 | 1315 | | |
1300 | 1316 | | |
| |||
0 commit comments