Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc. http://www.blynk.cc/
Dependents: Blynk_RBL_BLE_Nano Blynk_MicroBit Blynk_Serial Blynk_RBL_BLE_Nano
Diff: Blynk/BlynkDebug.h
- Revision:
- 13:ed6276c0afb7
- Parent:
- 9:7369ec77a3ea
- Child:
- 14:76d8fd871a4d
--- a/Blynk/BlynkDebug.h Thu Jan 12 02:21:21 2017 +0200 +++ b/Blynk/BlynkDebug.h Sun Apr 09 14:50:30 2017 +0300 @@ -41,6 +41,30 @@ #endif #endif +#if defined(LINUX) + #if defined(RASPBERRY) + #include <wiringPi.h> + #else + #define _POSIX_C_SOURCE 200809L + #include <time.h> + #include <unistd.h> + + static inline + void delay(unsigned long ms) + { + usleep(ms * 1000); + } + + static + millis_time_t millis() + { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts ); + return ( ts.tv_sec * 1000 + ts.tv_nsec / 1000000L ); + } + #endif +#endif + #if !defined(ARDUINO) || (ARDUINO < 151) #define BLYNK_NO_YIELD #endif @@ -139,7 +163,7 @@ bool prev_print = true; while (l2--) { const uint8_t c = *octets++ & 0xFF; - if (isprint(c)) { + if (c >= 32 && c < 127) { if (!prev_print) { BLYNK_PRINT.print(']'); } BLYNK_PRINT.print((char)c); prev_print = true;