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

main.cpp

Committer:
wataloh
Date:
2017-06-09
Revision:
21:d03c7bbb9f37
Parent:
16:283828f1f6fe

File content as of revision 21:d03c7bbb9f37:

#include "mbed.h"
#include "AferoCommHndlr.h"
//#include "pin_defines.h"
#include "RTC_Handler.h"
#include "Preferences.hpp"
#include "WakeUp.h"
#include "DebugIO.hpp"
#include "WatchDogWrapper.hpp"
#include "MCUResetReason.hpp"

int
main()
{
    WakeUp::calibrate();
    wait_ms(500);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    DebugIO::init();
    DebugIO::test();
    mbedSPI mbedspi;
    DigitalOut ASR1Reset(
        (PinName)PINS::ASR_1::RESET,
        PINS::ASR_1::SIG::RESET::DEASSERT);
    ASR1Reset = PINS::ASR_1::SIG::RESET::ASSERT;
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    ASR1Reset = PINS::ASR_1::SIG::RESET::DEASSERT;
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
    wait_ms(300);
#if defined(TARGET_KL25Z)
    WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z

    SERIAL_PRINT_DBG("reset reason: %s\n",MCUResetReason::ref()->getResetReasonStr());

    AferoCommHndlr *aHnd = AferoCommHndlr::create(&mbedspi);
    
    while(1) {
#if defined(TARGET_KL25Z)
        WatchDogWrapper::getSelf()->reset();
#endif //TARGET_KL25Z
        aHnd->loop();
    }
}