File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
hardware/arduino/sam/cores/arduino Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ ARDUINO 1.5.6 BETA
11
11
[core]
12
12
* sam: Fixed wrap-around bug in delay() (Mark Tillotson)
13
13
* sam: Fixed regression in analogRead() (fails to read multiple channels) (Mark Tillotson)
14
+ * sam: Optimized delayMicroseconds() (Rob Tillaart) #1121
14
15
* Optimized Print::print(String&) method, now uses internal string buffer to perform block write
15
16
16
17
ARDUINO 1.5.5 BETA 2013.11.28
Original file line number Diff line number Diff line change @@ -64,11 +64,12 @@ extern void delay( uint32_t dwMs ) ;
64
64
*/
65
65
static inline void delayMicroseconds (uint32_t ) __attribute__((always_inline , unused ));
66
66
static inline void delayMicroseconds (uint32_t usec ){
67
+ if (usec == 0 ) return ;
67
68
uint32_t n = usec * (VARIANT_MCK / 3000000 );
68
69
asm volatile (
69
70
"L_%=_delayMicroseconds:" "\n\t"
70
71
"subs %0, #1" "\n\t"
71
- "bge L_%=_delayMicroseconds" "\n"
72
+ "bne L_%=_delayMicroseconds" "\n"
72
73
: "+r" (n ) :
73
74
);
74
75
}
You can’t perform that action at this time.
0 commit comments