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
sensors/TimeEventHandler.hpp@23:e4d2316383a1, 2017-10-18 (annotated)
- Committer:
- Rhyme
- Date:
- Wed Oct 18 00:31:13 2017 +0000
- Revision:
- 23:e4d2316383a1
- Parent:
- 21:d03c7bbb9f37
pwm period is now 200us from default 20ms; veml6040->setCOLORCOnf is now AF_BIT | TRIG_BIT from 0x00;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wataloh | 1:b2a9a6f2c30e | 1 | #ifndef _TIME_EVENT_HANDLER_HPP_ |
wataloh | 1:b2a9a6f2c30e | 2 | #define _TIME_EVENT_HANDLER_HPP_ |
wataloh | 1:b2a9a6f2c30e | 3 | |
wataloh | 1:b2a9a6f2c30e | 4 | #include "Preferences.hpp" |
wataloh | 5:9d5c7ee80f3b | 5 | #include "DebugIO.hpp" |
wataloh | 1:b2a9a6f2c30e | 6 | |
wataloh | 1:b2a9a6f2c30e | 7 | template<typename A> class TimeEventHandler |
wataloh | 1:b2a9a6f2c30e | 8 | { |
wataloh | 1:b2a9a6f2c30e | 9 | protected: |
wataloh | 21:d03c7bbb9f37 | 10 | TimeEventHandler() |
wataloh | 21:d03c7bbb9f37 | 11 | { |
wataloh | 21:d03c7bbb9f37 | 12 | timeout = new Timeout(); |
wataloh | 21:d03c7bbb9f37 | 13 | } |
wataloh | 21:d03c7bbb9f37 | 14 | Timeout *timeout; |
wataloh | 1:b2a9a6f2c30e | 15 | PACKET packet; |
wataloh | 21:d03c7bbb9f37 | 16 | void (A::*cb)(); |
wataloh | 15:2c2c0a7c50c1 | 17 | int32_t interval_current; |
wataloh | 1:b2a9a6f2c30e | 18 | void read() |
wataloh | 1:b2a9a6f2c30e | 19 | { |
wataloh | 21:d03c7bbb9f37 | 20 | cb = &A::go; |
wataloh | 1:b2a9a6f2c30e | 21 | } |
wataloh | 1:b2a9a6f2c30e | 22 | void backToNOP() |
wataloh | 1:b2a9a6f2c30e | 23 | { |
wataloh | 21:d03c7bbb9f37 | 24 | cb = NULL; |
wataloh | 1:b2a9a6f2c30e | 25 | } |
wataloh | 15:2c2c0a7c50c1 | 26 | virtual void checkIntervalUpdate() |
wataloh | 15:2c2c0a7c50c1 | 27 | { |
wataloh | 15:2c2c0a7c50c1 | 28 | } |
wataloh | 1:b2a9a6f2c30e | 29 | public: |
wataloh | 21:d03c7bbb9f37 | 30 | int loop() |
wataloh | 1:b2a9a6f2c30e | 31 | { |
wataloh | 21:d03c7bbb9f37 | 32 | if(cb != NULL) |
wataloh | 1:b2a9a6f2c30e | 33 | { |
wataloh | 21:d03c7bbb9f37 | 34 | (A::self->*cb)(); |
wataloh | 1:b2a9a6f2c30e | 35 | } |
wataloh | 21:d03c7bbb9f37 | 36 | A::self->checkIntervalUpdate(); |
wataloh | 21:d03c7bbb9f37 | 37 | return 0; |
wataloh | 1:b2a9a6f2c30e | 38 | } |
wataloh | 1:b2a9a6f2c30e | 39 | }; |
wataloh | 1:b2a9a6f2c30e | 40 | |
wataloh | 1:b2a9a6f2c30e | 41 | #endif //_TIME_EVENT_HANDLER_HPP_ |