Skip to content

Conversation

@xoviat
Copy link
Contributor

@xoviat xoviat commented Nov 27, 2025

Reduce code duplication and allow use of dma for 32 bit timers. This precludes type-erasure of 32 bit timers, but not type erasure in general (eg. we would have Timer<U16> and Timer<U32> if we type-erased the timers).

A few points on this:

  • For the low-level timers, this requires passing in the correct word to arr, ccr, and any dma buffer. This is in contrast before when u32 was accepted inconsistently.
  • For the high-level timer, only the dma buffer is leaked; the other functions accept u32 for both 16 and 32 bit timers. This is because there is no way to convert a 16-bit buffer to a 32-bit buffer. It could be possible to abstract even this away, but I do not think this is ever a use-case that is needed for the additional complexity.

@xoviat xoviat marked this pull request as ready for review November 27, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant