Delays not working STM32F446RE
I am using STM32F446RE (nucleo board) and Keil uVision5.33..0
following is the snippet:
- include
- include “Board_LED.h”
int32_t custom_delay()
{
uint32_t unTimeDelay = 0;
uint32_t unTimeDelayCounter = 50000;
for(unTimeDelay = 0; unTimeDelay != unTimeDelayCounter; unTimeDelay++);
return 1;
}
int main (void)
{
uint32_t unLEDIndex = 0;
int32_t nFunctionReturn = 0;
nFunctionReturn = LED_Initialize();
while(1)
{
nFunctionReturn = LED_Off(unLEDIndex);
nFunctionReturn = custom_delay();
nFunctionReturn = LED_On(unLEDIndex);
}
return 0;
}
The delay above is not working.