diff --git a/IOSTM.cpp b/IOSTM.cpp index 8082cfb..e2f9b00 100644 --- a/IOSTM.cpp +++ b/IOSTM.cpp @@ -764,9 +764,16 @@ void CIO::setP25Int(bool on) #endif } +// Simple delay function for STM32 +// Example from: http://thehackerworkshop.com/?p=1209 void CIO::delayInt(unsigned int dly) { - unsigned int loopsPerMillisecond = (SystemCoreClock/1000) / 3; //3 clock cycles per loop +#if defined(STM32F7_NUCLEO) + unsigned int loopsPerMillisecond = (SystemCoreClock/1000); +#else + unsigned int loopsPerMillisecond = (SystemCoreClock/1000) / 3; +#endif + for (; dly > 0; dly--) { asm volatile //this routine waits (approximately) one millisecond