How to create a microseconds delay function in STM32F0
System Clock is clocked by AHB bus divided by 8. So simply divide the result by 8. Or better yet, when you currently multiply by 8000, multiply only by 1000.