Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stm32/timer: Make pyb.Timer() instances persistent.
Prior to this patch calling pyb.Timer(id) would always create a new timer instance, even if there was an existing one. This patch fixes this behaviour to match other peripherals, like UART, such that constructing a timer with just the id will retrieve any existing instances. The patch also refactors the way timers are validated on construction to simplify and reduce code size.
- Loading branch information
Showing
2 changed files
with
81 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters