diff options
Diffstat (limited to 'cores/arduino/wiring.h')
-rwxr-xr-x | cores/arduino/wiring.h | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h index 3701f6d..46d5334 100755 --- a/cores/arduino/wiring.h +++ b/cores/arduino/wiring.h @@ -66,13 +66,6 @@ extern "C"{ #undef abs #endif -//#define int(x) ((int)(x)) -//#define char(x) ((char)(x)) -//#define long(x) ((long)(x)) -//#define byte(x) ((uint8_t)(x)) -//#define float(x) ((float)(x)) -//#define boolean(x) ((uint8_t)((x)==0?0:1)) - #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #define abs(x) ((x)>0?(x):-(x)) @@ -89,6 +82,18 @@ extern "C"{ #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) +#define lowByte(w) ((w) & 0xff) +#define highByte(w) ((w) >> 8) + +#define bitRead(value, bit) (((value) >> (bit)) & 0x01) +#define bitSet(value, bit) ((value) |= (1UL << (bit))) +#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) +#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) + +typedef unsigned int word; + +#define bit(b) (1 << (b)) + typedef uint8_t boolean; typedef uint8_t byte; @@ -106,15 +111,6 @@ void serialWrite(unsigned char); int serialAvailable(void); int serialRead(void); void serialFlush(void); -void printMode(int); -void printByte(unsigned char c); -void printNewline(void); -void printString(const char *s); -void printInteger(long n); -void printHex(unsigned long n); -void printOctal(unsigned long n); -void printBinary(unsigned long n); -void printIntegerInBase(unsigned long n, unsigned long base); unsigned long millis(void); void delay(unsigned long); |