* AM2321的取温度间隔得大于2s,否则,i2c会不工作了 * SimpleTimer有个bug,会导致两次快速的读温度,现在读温度函数里加了保护 * Blynk有个bug,会导致无法把数据传到服务器 * 现在可以正常工作了

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BlynkDebug.cpp Source File

BlynkDebug.cpp

Go to the documentation of this file.
00001 /**
00002  * @file       BlynkDebug.cpp
00003  * @author     Volodymyr Shymanskyy
00004  * @license    This project is released under the MIT License (MIT)
00005  * @copyright  Copyright (c) 2015 Volodymyr Shymanskyy
00006  * @date       Jan 2015
00007  * @brief      Debug utilities for Arduino
00008  */
00009 
00010 #include <Blynk/BlynkDebug.h>
00011 #include "mbed.h"
00012 
00013 size_t BlynkFreeRam()
00014 {
00015 #if defined(__AVR__)
00016     extern int __heap_start, *__brkval;
00017     int v;
00018     return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
00019 #else
00020     return 0;
00021 #endif
00022 }
00023 
00024 void BlynkReset()
00025 {
00026     void(*resetFunc)(void) = 0;
00027     resetFunc();
00028     for(;;); // To make compiler happy
00029 }
00030 
00031 void BlynkFatal()
00032 {
00033     wait_ms(10000L);
00034     BlynkReset();
00035 }
00036