diff options
author | Leon Lindenfelser <llindenfelser@multitech.com> | 2015-11-13 14:39:22 -0600 |
---|---|---|
committer | Leon Lindenfelser <llindenfelser@multitech.com> | 2015-11-13 14:39:22 -0600 |
commit | a37b4b2a208989c45484f90dab141ca0191e7714 (patch) | |
tree | 0e6cfc6f3d821d583ed565d327b219f3e3800840 /main.cpp | |
parent | dd557b5a21d64cd49b1179ac891ffb2c63dee6d8 (diff) | |
download | mtdot-box-evb-factory-firmware-a37b4b2a208989c45484f90dab141ca0191e7714.tar.gz mtdot-box-evb-factory-firmware-a37b4b2a208989c45484f90dab141ca0191e7714.tar.bz2 mtdot-box-evb-factory-firmware-a37b4b2a208989c45484f90dab141ca0191e7714.zip |
CommandTerminal working on debug port
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -4,6 +4,7 @@ // MTS headers #include "mDot.h" #include "MTSLog.h" +#include "CommandTerminal.h" // sensor headers #include "ISL29011.h" #include "MMA845x.h" @@ -34,6 +35,9 @@ ButtonHandler* buttons; // Serial debug port Serial debug(USBTX, USBRX); +mts::MTSSerial serial(USBTX, USBRX, 512, 512); + + int main() { debug.baud(115200); @@ -50,6 +54,20 @@ int main() { osThreadId main_id = Thread::gettid(); buttons = new ButtonHandler(main_id); + + + mDot* dot = mDot::getInstance(); + if(dot){ + logInfo("dot created"); + CommandTerminal term(serial, dot); + term.start(); + } + else { + logInfo("Radio Init Failed!"); + } + + + while (true) { char buf[16]; size_t size; @@ -59,12 +77,15 @@ int main() { ButtonEvent ev = buttons->getButtonEvent(); switch (ev) { case sw1_press: + logInfo("SW1 press"); size = snprintf(buf, sizeof(buf), "SW1 press"); break; case sw1_hold: + logInfo("SW1 hold"); size = snprintf(buf, sizeof(buf), "SW1 hold"); break; case sw2_press: + logInfo("SW2 press"); size = snprintf(buf, sizeof(buf), "SW2 press"); break; } |