Closed gbip closed 5 years ago
I would define 2 functions taking clock and returning bus clock and multiplier, and give the name of the good function to the macro.
@therealprof sadly this repo doesn't use fmt, maybe we can do a PR to use it ?
Moreover, inside macro, fmt will not work.
@TeXitoi I think formatting is mostly up-to-date but rustfmt rules changed a bit over time. I'd prefer formatting code as we go rather than doing it all in one PR but you're right it doesn't work in macros.
Please, correct typo in TIM4: tim3rst -> tim4rst
@burrbull Nice spotting!
Is it better now ? For the formatting I tried to format the code by hand, tell me if it's not correct.
Fixed a bug in the timer code that would miscalculate TIM1 ARR and PRESC. TIM1 is not on the same bus as TIM2-8 so we have to adjust how we compute its period.
If you know a way to avoid redefining an enum (for example using the APB identifier) please tell me !