Define a _NOP() macro

Recent avr-libc releases define one, but this allows using it also on
older avr-libc releases.
This commit is contained in:
Matthijs Kooijman 2013-12-01 19:18:31 +01:00 committed by Cristian Maglie
parent 6cce4787bf
commit 6ac8185c08
1 changed files with 4 additions and 0 deletions

View File

@ -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;