summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorLeon Lindenfelser <llindenfelser@multitech.com>2015-11-13 14:39:22 -0600
committerLeon Lindenfelser <llindenfelser@multitech.com>2015-11-13 14:39:22 -0600
commita37b4b2a208989c45484f90dab141ca0191e7714 (patch)
tree0e6cfc6f3d821d583ed565d327b219f3e3800840 /main.cpp
parentdd557b5a21d64cd49b1179ac891ffb2c63dee6d8 (diff)
downloadmtdot-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.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 5049cc2..f5f00c5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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;
}