pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT

Dependencies:   mbed MMA8451Q USBDevice WakeUp vt100

Fork of afero_node_suntory_2017_06_15 by Orefatoi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Singletoned.hpp Source File

Singletoned.hpp

00001 #ifndef _SINGLETONED_HPP_
00002 #define _SINGLETONED_HPP_
00003 
00004 template<typename A> class Singletoned
00005 {
00006 protected:
00007     static A *self;
00008 public:
00009     static A* getSelf()
00010     {
00011         return self == NULL ? self = new A() : self;
00012     }
00013     static void delSelf()
00014     {
00015         if(self!=NULL)
00016         {
00017             delete self;
00018             self = NULL;
00019         }
00020     }
00021 };
00022 
00023 template<typename A> A* Singletoned<A>::self=NULL;
00024 
00025 #endif //_SINGLETONED_HPP_