mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-04-05 14:37:02 +00:00
Adding LEDs selftest at start-up
This commit is contained in:
parent
cce2cc3cfc
commit
70e1fd4264
5 changed files with 66 additions and 1 deletions
19
IOSTM.cpp
19
IOSTM.cpp
|
|
@ -764,4 +764,23 @@ void CIO::setP25Int(bool on)
|
|||
#endif
|
||||
}
|
||||
|
||||
void CIO::delayInt(unsigned int dly)
|
||||
{
|
||||
unsigned int loopsPerMillisecond = (SystemCoreClock/1000) / 3; //3 clock cycles per loop
|
||||
for (; dly > 0; dly--)
|
||||
{
|
||||
asm volatile //this routine waits (approximately) one millisecond
|
||||
(
|
||||
"mov r3, %[loopsPerMillisecond] \n\t" //load the initial loop counter
|
||||
"loop: \n\t"
|
||||
"subs r3, #1 \n\t"
|
||||
"bne loop \n\t"
|
||||
|
||||
: //empty output list
|
||||
: [loopsPerMillisecond] "r" (loopsPerMillisecond) //input to the asm routine
|
||||
: "r3", "cc" //clobber list
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue