rust-embedded / embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems
Apache License 2.0
1.95k stars 197 forks source link

Document SemVer hazards of `spi::Operation::DelayNs` #552

Closed GrantM11235 closed 9 months ago

GrantM11235 commented 9 months ago

Imagine this timeline:

Aside from making actual changes to the SpiDevice trait, I can only think of two possible "solutions":

  1. Tell the author of cool-driver that by adding a DelayNs they have made a breaking change and they must release it as version 2.0.0 instead.
  2. Tell the user that they shouldn't really use NoDelay, but if they do they must pin the version of any dependency that they use it with.

I don't really like either of these options, but I don't have any better ideas.

Dirbaio commented 9 months ago

opened #558 to address this. It picks solution 2, which is sort of what we agreed on when we added the "no delay" versions: it's theoretically semver-breaking but in practice it's going to be rare that a driver starts using delays if it wasn't before.