stm32f4xx-hal icon indicating copy to clipboard operation
stm32f4xx-hal copied to clipboard

Passing delay to device driver

Open xiugaze opened this issue 3 years ago • 1 comments

Hi, Is there a proper way implemented to use blocking delay inside of a device driver? There doesn't seem to be a way to create a driver struct that has access to a delay without either

  1. Giving ownership of the delay to the struct
  2. Passing a reference to a delay within every API call.

Clone and copy are not implemented for stm32f4xx_hal::timer::SYST.

I don't know if I am just missing something obvious or the proper way to do this.

I did look into this here, but I can't find a conclusive answer on how I should be designing drivers.

xiugaze avatar Oct 12 '22 05:10 xiugaze

The second option is much more flexible, so it is more preferable. You can discuss it in matrix if you are not sure.

burrbull avatar Oct 12 '22 14:10 burrbull