mirror of https://github.com/markqvist/MMDVM.git
Fix delay function for F767
parent
ea37f67b91
commit
990bf2a16a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue