WProgram.h
1 #ifndef WProgram_h 2 #define WProgram_h 3 4 #include <stdlib.h> 5 #include <string.h> 6 #include <math.h> 7 8 #ifdef GCC_VERSION 9 #if (GCC_VERSION < 40300) 10 #warning "Your avr-gcc and avr-libc are too old, please upgrade" 11 #endif 12 #if (GCC_VERSION >= 40300) && (GCC_VERSION < 40302) 13 // gcc 4.3.0 fails to save context for some interrupt routines - very ugly 14 #warning "Buggy GCC 4.3.0 compiler, please upgrade!" 15 #endif 16 #endif 17 18 #include <avr/interrupt.h> 19 #include "wiring.h" 20 21 #ifdef __cplusplus 22 #include "usb_api.h" 23 #include "WCharacter.h" 24 #include "WString.h" 25 #include "HardwareSerial.h" 26 #include "elapsedMillis.h" 27 28 uint16_t makeWord(uint16_t w); 29 uint16_t makeWord(byte h, byte l); 30 31 #define word(...) makeWord(__VA_ARGS__) 32 33 unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); 34 35 void tone(uint8_t pin, uint16_t frequency, uint32_t duration = 0); 36 void noTone(uint8_t pin); 37 38 // WMath prototypes 39 long random(long); 40 long random(long, long); 41 void randomSeed(unsigned int); 42 long map(long, long, long, long, long); 43 44 #include "pins_arduino.h" 45 46 #endif // __cplusplus 47 48 #endif // WProgram_h