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

Committer:
wataloh
Date:
Tue Feb 28 02:09:06 2017 +0000
Revision:
5:9d5c7ee80f3b
Parent:
2:dfe671e31221
Child:
6:88cc04eb613a
added watchdog timer for kl25z.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wataloh 0:20bce0dcc921 1 #include "mbed.h"
wataloh 0:20bce0dcc921 2 #include "AferoCommHndlr.h"
wataloh 0:20bce0dcc921 3 #include "pin_defines.h"
wataloh 5:9d5c7ee80f3b 4 //#include "debugIO.h"
wataloh 0:20bce0dcc921 5 #include "RTC_Handler.h"
wataloh 1:b2a9a6f2c30e 6 #include "Preferences.hpp"
wataloh 2:dfe671e31221 7 #include "WakeUp.h"
wataloh 5:9d5c7ee80f3b 8 #include "DebugIO.hpp"
wataloh 5:9d5c7ee80f3b 9 #include "ImAWatchDog.hpp"
wataloh 0:20bce0dcc921 10
wataloh 0:20bce0dcc921 11 Timer t;
wataloh 0:20bce0dcc921 12
wataloh 0:20bce0dcc921 13 int
wataloh 0:20bce0dcc921 14 main()
wataloh 0:20bce0dcc921 15 {
wataloh 2:dfe671e31221 16 WakeUp::calibrate();
wataloh 2:dfe671e31221 17 wait_ms(1000);
wataloh 0:20bce0dcc921 18 t.start();
wataloh 5:9d5c7ee80f3b 19 DebugIO::init();
wataloh 5:9d5c7ee80f3b 20 DebugIO::test();
wataloh 0:20bce0dcc921 21 RTC_Handler::getInstance()->setUTC(1483228800);
wataloh 0:20bce0dcc921 22 time_t t_t = RTC_Handler::getInstance()->getUTC();
wataloh 0:20bce0dcc921 23 mbedSPI mbedspi;
wataloh 1:b2a9a6f2c30e 24 DigitalOut ASR1Reset(
wataloh 1:b2a9a6f2c30e 25 (PinName)PINS::ASR_1::RESET,
wataloh 1:b2a9a6f2c30e 26 PINS::ASR_1::SIG::RESET::DEASSERT);
wataloh 1:b2a9a6f2c30e 27 ASR1Reset = PINS::ASR_1::SIG::RESET::ASSERT;
wataloh 1:b2a9a6f2c30e 28 wait_ms(1000);
wataloh 1:b2a9a6f2c30e 29 ASR1Reset = PINS::ASR_1::SIG::RESET::DEASSERT;
wataloh 1:b2a9a6f2c30e 30 wait_ms(1000);
wataloh 0:20bce0dcc921 31 AferoCommHndlr *aHnd = AferoCommHndlr::create(&t,&mbedspi);
wataloh 5:9d5c7ee80f3b 32 #if defined(TARGET_KL25Z)
wataloh 5:9d5c7ee80f3b 33 ImAWatchDog wtd;
wataloh 5:9d5c7ee80f3b 34 #endif
wataloh 0:20bce0dcc921 35 while(1) {
wataloh 5:9d5c7ee80f3b 36 #if defined(TARGET_KL25Z)
wataloh 5:9d5c7ee80f3b 37 wtd.feed_dog();
wataloh 5:9d5c7ee80f3b 38 #endif
wataloh 0:20bce0dcc921 39 aHnd->loop();
wataloh 0:20bce0dcc921 40 }
wataloh 0:20bce0dcc921 41 }