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 TimeEventHandler.hpp Source File

TimeEventHandler.hpp

00001 #ifndef _TIME_EVENT_HANDLER_HPP_
00002 #define _TIME_EVENT_HANDLER_HPP_
00003 
00004 #include "Preferences.hpp"
00005 #include "DebugIO.hpp"
00006 
00007 template<typename A> class TimeEventHandler
00008 {
00009 protected:
00010     TimeEventHandler()
00011     {
00012         timeout = new Timeout();
00013     }
00014     Timeout *timeout;
00015     PACKET packet;
00016     void (A::*cb)();
00017     int32_t interval_current;
00018     void read()
00019     {
00020         cb = &A::go;
00021     }
00022     void backToNOP()
00023     {
00024         cb = NULL;
00025     }
00026     virtual void checkIntervalUpdate()
00027     {
00028     }
00029 public:
00030     int loop()
00031     {
00032         if(cb != NULL)
00033         {
00034             (A::self->*cb)();
00035         }
00036         A::self->checkIntervalUpdate();
00037         return 0;
00038     }
00039 };
00040 
00041 #endif //_TIME_EVENT_HANDLER_HPP_