Added support for timers 6 and 7
STM32: Fixed critical sections
STM32: Added mutex; clock made thread safe