vedderb/bldc — pull request #2 by cyrilh (2014-08-20 22:02:45+00:00)
Title: Merging my hardware with your project

I tried to make each commit self explanatory:
- fix in the Makefile: I got some warnings due to that. removing it yielded errors which I think I fixed by following comments in a file in the toolchain or chibios, try to grep for DSTM32F40_41xxx in those
- added my "Plessboard" hardware (incompatible TIM8 used for PWM output)
- rewrite of commutate... well the exact function is "set_next_comm_step", the purpose is that it was easy to make simpler to maintain... and it makes the following patch much simpler to read
- critical sections... figure out but I assume change of the volatile value in the middle would be wrong

Finally the major change in timers... read the comments added at the start of main.c, motivations for changes are:
- I need TIM8 for my motor PWM
- I plan for future use of both TIM1 and TIM8 for two simultaneous motors
- your TIM8 replaced by TIM3 slave of TIM1 and TIM5 slave of TIM8 (as that allow use of same CCR as ADC trigger)
- your TIM3 replaced by TIM4
- your TIM4 replaced by TIM14 ... well that was unecessary, TIM3 could have become TIM14!, sorry here for historical reason.

Hope this breaks nothing and is to your liking.

Cyril