From eb527712baa96d65f0a4bd5d0ce3ec19a708f6f7 Mon Sep 17 00:00:00 2001 From: Leon Lindenfelser Date: Thu, 19 Nov 2015 15:12:11 -0600 Subject: Added ModeConfig code. It builds, the screen works and a debug message for config mode prints but the AT command parser is not working. --- Mode/ModeConfig.cpp | 26 ++++++++++++++++++++++++++ Mode/ModeConfig.h | 21 +++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Mode/ModeConfig.cpp create mode 100644 Mode/ModeConfig.h (limited to 'Mode') diff --git a/Mode/ModeConfig.cpp b/Mode/ModeConfig.cpp new file mode 100644 index 0000000..afabab5 --- /dev/null +++ b/Mode/ModeConfig.cpp @@ -0,0 +1,26 @@ +#include "ModeConfig.h" +#include "MTSLog.h" +#include "MTSText.h" +#include "CommandTerminal.h" + +ModeConfig::ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot) + : Mode(lcd, buttons), + _lc(lcd), + _dot(dot) +{} + +ModeConfig::~ModeConfig() {} + +bool ModeConfig::start() { + // clear any stale signals + osSignalClear(_main_id, buttonSignal); + + _lc.display(); + + logInfo("config mode"); + + mts::MTSSerial serial(USBTX, USBRX, 512, 512); + + CommandTerminal term(serial, _dot, _buttons); + return term.start(); +} diff --git a/Mode/ModeConfig.h b/Mode/ModeConfig.h new file mode 100644 index 0000000..be478dd --- /dev/null +++ b/Mode/ModeConfig.h @@ -0,0 +1,21 @@ +#ifndef __MODECONFIG_H__ +#define __MODECONFIG_H__ + +#include "Mode.h" +#include "LayoutConfig.h" +#include "mDot.h" + +class ModeConfig : public Mode { + public: + ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot); + ~ModeConfig(); + + bool start(); + + private: + LayoutConfig _lc; + mDot* _dot; + ButtonHandler::ButtonEvent _be; +}; + +#endif -- cgit v1.2.3