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
util/WatchDogWrapper.cpp@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 | #if defined(TARGET_KL25Z) |
wataloh | 21:d03c7bbb9f37 | 2 | |
wataloh | 21:d03c7bbb9f37 | 3 | #include "WatchDogWrapper.hpp" |
wataloh | 21:d03c7bbb9f37 | 4 | |
wataloh | 21:d03c7bbb9f37 | 5 | void WatchDogWrapper::empty() |
wataloh | 21:d03c7bbb9f37 | 6 | { |
wataloh | 21:d03c7bbb9f37 | 7 | } |
wataloh | 21:d03c7bbb9f37 | 8 | |
wataloh | 21:d03c7bbb9f37 | 9 | void WatchDogWrapper::_reset() |
wataloh | 21:d03c7bbb9f37 | 10 | { |
wataloh | 21:d03c7bbb9f37 | 11 | SIM->SRVCOP = (uint32_t)0x55u; |
wataloh | 21:d03c7bbb9f37 | 12 | SIM->SRVCOP = (uint32_t)0xAAu; |
wataloh | 21:d03c7bbb9f37 | 13 | } |
wataloh | 21:d03c7bbb9f37 | 14 | |
wataloh | 21:d03c7bbb9f37 | 15 | WatchDogWrapper::WatchDogWrapper() |
wataloh | 21:d03c7bbb9f37 | 16 | { |
wataloh | 21:d03c7bbb9f37 | 17 | SIM->COPC = 0x0C ; /* default value */ |
wataloh | 21:d03c7bbb9f37 | 18 | pReset = &WatchDogWrapper::_reset; |
wataloh | 21:d03c7bbb9f37 | 19 | } |
wataloh | 21:d03c7bbb9f37 | 20 | |
wataloh | 21:d03c7bbb9f37 | 21 | void WatchDogWrapper::kick_the_bucket() |
wataloh | 21:d03c7bbb9f37 | 22 | { |
wataloh | 21:d03c7bbb9f37 | 23 | pReset = &WatchDogWrapper::empty; |
wataloh | 21:d03c7bbb9f37 | 24 | SCB->AIRCR = 0x05FA0004 ; |
wataloh | 21:d03c7bbb9f37 | 25 | } |
wataloh | 21:d03c7bbb9f37 | 26 | |
wataloh | 21:d03c7bbb9f37 | 27 | void WatchDogWrapper::reset() |
wataloh | 21:d03c7bbb9f37 | 28 | { |
wataloh | 21:d03c7bbb9f37 | 29 | (this->*pReset)(); |
wataloh | 21:d03c7bbb9f37 | 30 | } |
wataloh | 21:d03c7bbb9f37 | 31 | |
wataloh | 21:d03c7bbb9f37 | 32 | #endif //TARGET_KL25Z |