mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-11 14:24:11 +02:00
Fix delay function for F767
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user