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:
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?

UserRevisionLine numberNew contents of line
wataloh 0:20bce0dcc921 1 #include "mbed.h"
wataloh 0:20bce0dcc921 2 #include "AferoCommHndlr.h"
wataloh 16:283828f1f6fe 3 //#include "pin_defines.h"
wataloh 0:20bce0dcc921 4 #include "RTC_Handler.h"
wataloh 1:b2a9a6f2c30e 5 #include "Preferences.hpp"
wataloh 2:dfe671e31221 6 #include "WakeUp.h"
wataloh 5:9d5c7ee80f3b 7 #include "DebugIO.hpp"
wataloh 21:d03c7bbb9f37 8 #include "WatchDogWrapper.hpp"
wataloh 10:02e481a80843 9 #include "MCUResetReason.hpp"
wataloh 0:20bce0dcc921 10
wataloh 0:20bce0dcc921 11 int
wataloh 0:20bce0dcc921 12 main()
wataloh 0:20bce0dcc921 13 {
wataloh 2:dfe671e31221 14 WakeUp::calibrate();
wataloh 6:88cc04eb613a 15 wait_ms(500);
wataloh 6:88cc04eb613a 16 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 17 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 18 #endif //TARGET_KL25Z
wataloh 5:9d5c7ee80f3b 19 DebugIO::init();
wataloh 5:9d5c7ee80f3b 20 DebugIO::test();
wataloh 0:20bce0dcc921 21 mbedSPI mbedspi;
wataloh 1:b2a9a6f2c30e 22 DigitalOut ASR1Reset(
wataloh 1:b2a9a6f2c30e 23 (PinName)PINS::ASR_1::RESET,
wataloh 1:b2a9a6f2c30e 24 PINS::ASR_1::SIG::RESET::DEASSERT);
wataloh 1:b2a9a6f2c30e 25 ASR1Reset = PINS::ASR_1::SIG::RESET::ASSERT;
wataloh 6:88cc04eb613a 26 wait_ms(300);
wataloh 6:88cc04eb613a 27 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 28 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 29 #endif //TARGET_KL25Z
wataloh 6:88cc04eb613a 30 wait_ms(300);
wataloh 6:88cc04eb613a 31 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 32 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 33 #endif //TARGET_KL25Z
wataloh 6:88cc04eb613a 34 wait_ms(300);
wataloh 6:88cc04eb613a 35 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 36 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 37 #endif //TARGET_KL25Z
wataloh 1:b2a9a6f2c30e 38 ASR1Reset = PINS::ASR_1::SIG::RESET::DEASSERT;
wataloh 6:88cc04eb613a 39 wait_ms(300);
wataloh 6:88cc04eb613a 40 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 41 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 42 #endif //TARGET_KL25Z
wataloh 6:88cc04eb613a 43 wait_ms(300);
wataloh 6:88cc04eb613a 44 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 45 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 46 #endif //TARGET_KL25Z
wataloh 6:88cc04eb613a 47 wait_ms(300);
wataloh 6:88cc04eb613a 48 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 49 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 50 #endif //TARGET_KL25Z
wataloh 6:88cc04eb613a 51
wataloh 10:02e481a80843 52 SERIAL_PRINT_DBG("reset reason: %s\n",MCUResetReason::ref()->getResetReasonStr());
wataloh 10:02e481a80843 53
wataloh 21:d03c7bbb9f37 54 AferoCommHndlr *aHnd = AferoCommHndlr::create(&mbedspi);
wataloh 10:02e481a80843 55
wataloh 0:20bce0dcc921 56 while(1) {
wataloh 5:9d5c7ee80f3b 57 #if defined(TARGET_KL25Z)
wataloh 21:d03c7bbb9f37 58 WatchDogWrapper::getSelf()->reset();
wataloh 6:88cc04eb613a 59 #endif //TARGET_KL25Z
wataloh 0:20bce0dcc921 60 aHnd->loop();
wataloh 0:20bce0dcc921 61 }
wataloh 0:20bce0dcc921 62 }