gfroerli / firmware

Firmware for the water temperature sensor project
GNU General Public License v3.0
6 stars 1 forks source link

Use delay from the HAL crate #29

Closed rnestler closed 6 years ago

rnestler commented 6 years ago

Why did you not replace sleep everywhere?

You probably mean this

The thing is, during clock setup the clock is not yet setup, so the HAL delay function would not work as expected. What I really wan't to do is:

  1. Move clock initialization into HAL crate
  2. Delay for a certain amount of instructions at that point (the for loop with nop doesn't really guarantee how many instructions are executed, since it depends on various things like debug vs. release)
dbrgn commented 6 years ago

Ah, sounds sensible :slightly_smiling_face: