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

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BlynkTemplates.h Source File

BlynkTemplates.h

00001 class BlynkStackOnly
00002 {
00003 protected:
00004   BlynkStackOnly() {}
00005   ~BlynkStackOnly() {}
00006 private:
00007   void* operator new(size_t size);
00008   void operator delete(void *p);
00009 };
00010 
00011 class BlynkNonCopyable
00012 {
00013 protected:
00014   BlynkNonCopyable(){}
00015   ~BlynkNonCopyable(){}
00016 
00017 private:
00018   /// @brief Declared as private to prevent usage of copy constructor
00019   BlynkNonCopyable(const BlynkNonCopyable&);
00020   /// @brief Declared as private to prevent usage of assignment operator
00021   BlynkNonCopyable& operator=(const BlynkNonCopyable&);
00022 };
00023 
00024 template<typename T>
00025 class BlynkSingleton: public BlynkNonCopyable
00026 {
00027 public:
00028   /** @brief Returns the instance of the singleton type
00029    When called for the first time, the singleton instance will be
00030    created. All subsequent calls will return a reference to the
00031    previously created instance.
00032    @return The singleton instance
00033    */
00034   static T* instance()
00035   {
00036     static T instance;
00037     return &instance;
00038   }
00039 protected:
00040   BlynkSingleton() {}
00041   ~BlynkSingleton() {}
00042 };
00043 
00044