/** * @file TinyGsmCommon.h * @author Volodymyr Shymanskyy * @license LGPL-3.0 * @copyright Copyright (c) 2016 Volodymyr Shymanskyy * @date Nov 2016 */ #ifndef TinyGsmCommon_h #define TinyGsmCommon_h #if defined(SPARK) || defined(PARTICLE) #include "Particle.h" #elif defined(ARDUINO) #if ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif #endif #include #include #ifndef TINY_GSM_YIELD #define TINY_GSM_YIELD() { delay(0); } #endif #if defined(__AVR__) #define TINY_GSM_PROGMEM PROGMEM typedef const __FlashStringHelper* GsmConstStr; #define GFP(x) (reinterpret_cast(x)) #define GF(x) F(x) #else #define TINY_GSM_PROGMEM typedef const char* GsmConstStr; #define GFP(x) x #define GF(x) x #endif #ifdef GSM_DEBUG namespace { template static void DBG(T last) { GSM_DEBUG.println(last); } template static void DBG(T head, Args... tail) { GSM_DEBUG.print(head); GSM_DEBUG.print(' '); DBG(tail...); } } #else #define DBG(...) #endif template const T& TinyGsmMin(const T& a, const T& b) { return (b < a) ? b : a; } template const T& TinyGsmMax(const T& a, const T& b) { return (b < a) ? a : b; } #endif