Skip to content
Snippets Groups Projects
Unverified Commit 02168c86 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

stm32f7: slightly un-break delay_us and delay_ms

parent 8d38d364
No related branches found
No related tags found
No related merge requests found
Pipeline #100 failed
......@@ -64,19 +64,21 @@ extern void loop();
volatile char run_loop = 0;
#endif
// for 216 MHz(?)
static volatile int delay_counter;
// horribly broken
void Arch::delay_us(unsigned int const us)
{
volatile int x = us * 145;
while (x--) {
delay_counter = us * 37;
while (delay_counter--) {
__asm("nop");
}
}
// horribly broken
void Arch::delay_ms(unsigned int const ms)
{
for (unsigned int i = 0; i < ms; i++) {
volatile int x = 143990;
while (x--) {
delay_counter = 36364;
while (delay_counter--) {
__asm("nop");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment