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/Singletoned.hpp@21:d03c7bbb9f37, 2017-06-09 (annotated)
- Committer:
- wataloh
- Date:
- Fri Jun 09 01:49:53 2017 +0000
- Revision:
- 21:d03c7bbb9f37
Added the following process; When VEML6040 library returns NACK, forces software reset
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wataloh | 21:d03c7bbb9f37 | 1 | #ifndef _SINGLETONED_HPP_ |
wataloh | 21:d03c7bbb9f37 | 2 | #define _SINGLETONED_HPP_ |
wataloh | 21:d03c7bbb9f37 | 3 | |
wataloh | 21:d03c7bbb9f37 | 4 | template<typename A> class Singletoned |
wataloh | 21:d03c7bbb9f37 | 5 | { |
wataloh | 21:d03c7bbb9f37 | 6 | protected: |
wataloh | 21:d03c7bbb9f37 | 7 | static A *self; |
wataloh | 21:d03c7bbb9f37 | 8 | public: |
wataloh | 21:d03c7bbb9f37 | 9 | static A* getSelf() |
wataloh | 21:d03c7bbb9f37 | 10 | { |
wataloh | 21:d03c7bbb9f37 | 11 | return self == NULL ? self = new A() : self; |
wataloh | 21:d03c7bbb9f37 | 12 | } |
wataloh | 21:d03c7bbb9f37 | 13 | static void delSelf() |
wataloh | 21:d03c7bbb9f37 | 14 | { |
wataloh | 21:d03c7bbb9f37 | 15 | if(self!=NULL) |
wataloh | 21:d03c7bbb9f37 | 16 | { |
wataloh | 21:d03c7bbb9f37 | 17 | delete self; |
wataloh | 21:d03c7bbb9f37 | 18 | self = NULL; |
wataloh | 21:d03c7bbb9f37 | 19 | } |
wataloh | 21:d03c7bbb9f37 | 20 | } |
wataloh | 21:d03c7bbb9f37 | 21 | }; |
wataloh | 21:d03c7bbb9f37 | 22 | |
wataloh | 21:d03c7bbb9f37 | 23 | template<typename A> A* Singletoned<A>::self=NULL; |
wataloh | 21:d03c7bbb9f37 | 24 | |
wataloh | 21:d03c7bbb9f37 | 25 | #endif //_SINGLETONED_HPP_ |