Commit Graph

3 Commits

Author SHA1 Message Date
Damien George d29b709642 stm32/timer: Enable ARPE so that timer freq can be changed smoothly.
The timer prescaler is buffered by default, and this patch enables ARPE
which buffers the auto-reload register.  With both of these registers
buffered it's now possible to smoothly change the timer's frequency and
have a smoothly varying PWM output.
2017-09-25 15:25:08 +10:00
Damien George d7cd1d2027 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.
2017-09-13 16:20:42 +10:00
Damien George 01dd7804b8 ports: Make new ports/ sub-directory and move all ports there.
This is to keep the top-level directory clean, to make it clear what is
core and what is a port, and to allow the repository to grow with new ports
in a sustainable way.
2017-09-06 13:40:51 +10:00