diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2013-12-01 19:18:31 +0100 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2014-01-16 16:29:41 +0100 |
commit | 494929495ea1d64850f77a198d67a66f18a85630 (patch) | |
tree | 1ec2f75f5db8e5aa3ba2fbc73b8e13d909dab91f | |
parent | fc45ef0846a426bbc15b1f74b2c70b04bb68e557 (diff) |
Define a _NOP() macro
Recent avr-libc releases define one, but this allows using it also on
older avr-libc releases.
-rw-r--r-- | cores/arduino/Arduino.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 7bf5119..8502e44 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -88,6 +88,10 @@ void yield(void); #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) +// avr-libc defines _NOP() since 1.6.2 +#ifndef _NOP +#define _NOP() do { __asm__ volatile ("nop"); } while (0) +#endif typedef unsigned int word; |