From 494929495ea1d64850f77a198d67a66f18a85630 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 1 Dec 2013 19:18:31 +0100 Subject: Define a _NOP() macro Recent avr-libc releases define one, but this allows using it also on older avr-libc releases. --- cores/arduino/Arduino.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cores') 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; -- cgit v1.2.3-18-g5258