Skip to content

Commit

Permalink
Improve delayMicroseconds on Teensy 2.0 (Graham)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Oct 23, 2017
1 parent e1fd3e6 commit 4b60f9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion teensy/core_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,8 @@ static inline void delayMicroseconds(uint16_t usec)
uint8_t tmp2 = tmp;
asm volatile(
"L_%=_loop:" // 1 to load
"subi %0, 1" "\n\t" // 2
"subi %0, 1" "\n\t" // 1
"nop" "\n\t" // 1
"brne L_%=_loop" "\n\t" // 2 (1 on last)
: "=d" (tmp2)
: "0" (tmp2)
Expand Down

0 comments on commit 4b60f9f

Please sign in to comment.