Question
Timing problem with ADC_DelayMicroSecond(uint32_t microSecond)
Posted on September 22, 2016 at 16:02
This HAL code seems to run 12x slower then expected.
/** * @brief Delay micro seconds * @param microSecond : delay * @retval None */static void ADC_DelayMicroSecond(uint32_t microSecond){ /* Compute number of CPU cycles to wait for */ __IO uint32_t waitLoopIndex = (microSecond * (SystemCoreClock / 1000000U)); while(waitLoopIndex != 0U) { waitLoopIndex--; } }Peter