diff options
author | Leon Lindenfelser <llindenfelser@multitech.com> | 2016-01-06 15:01:29 -0600 |
---|---|---|
committer | Leon Lindenfelser <llindenfelser@multitech.com> | 2016-01-06 15:01:29 -0600 |
commit | d75af02d4a1d824df7fee58baaffc0c4759fb78a (patch) | |
tree | a84f22d1781e0eeb8faad097992fb35ff4d75471 | |
parent | cbda95f01fd109c5b9d9f35624f57bd4cca069d8 (diff) | |
download | mtdot-box-evb-factory-firmware-d75af02d4a1d824df7fee58baaffc0c4759fb78a.tar.gz mtdot-box-evb-factory-firmware-d75af02d4a1d824df7fee58baaffc0c4759fb78a.tar.bz2 mtdot-box-evb-factory-firmware-d75af02d4a1d824df7fee58baaffc0c4759fb78a.zip |
Change the verbiage of the configuration help screen. Scrolls 3 steps now.
-rw-r--r-- | Layout/LayoutConfig.cpp | 68 | ||||
-rw-r--r-- | Layout/LayoutConfig.h | 14 | ||||
-rw-r--r-- | Mode/ModeConfig.cpp | 3 |
3 files changed, 72 insertions, 13 deletions
diff --git a/Layout/LayoutConfig.cpp b/Layout/LayoutConfig.cpp index dc28738..dd044fa 100644 --- a/Layout/LayoutConfig.cpp +++ b/Layout/LayoutConfig.cpp @@ -3,21 +3,71 @@ LayoutConfig::LayoutConfig(DOGS102* lcd) : Layout(lcd), _lMode(0, 0, "Configuration"), - _lHelp1(0, 2, "Connect USB debug"), - _lHelp2(0, 3, "to PC at 115200"), - _lHelp3(0, 4, "baud to configure") -{} + _fHeader(0, 1, 17), + _fMsg1(0, 3, 17), + _fMsg2(0, 4, 17), + _fMsg3(0, 5, 17) +{ + _timer.start(); +} LayoutConfig::~LayoutConfig() {} void LayoutConfig::display() { clear(); startUpdate(); - writeLabel(_lMode); - writeLabel(_lHelp1); - writeLabel(_lHelp2); - writeLabel(_lHelp3); - endUpdate(); + update1of3(); +} + +void LayoutConfig::roll(){ + if(_timer.read_ms() < _duration){ + return; + } + if(_screen == 3){ + _screen = 1; + } + else + _screen++; + + switch(_screen){ + case 1: + update1of3(); + break; + case 2: + update2of3(); + break; + case 3: + update3of3(); + break; + } +} + +void LayoutConfig::update1of3() { + _screen = 1; + _timer.reset(); + _duration = 4000; + writeField(_fHeader, string("1 of 3"), true); + writeField(_fMsg1, string("Connect to MTMDK"), true); + writeField(_fMsg2, string("using the 8 pin"), true); + writeField(_fMsg3, string("ribbon cable."), true); +} + +void LayoutConfig::update2of3() { + _timer.reset(); + _duration = 3000; + writeField(_fHeader, string("2 of 3"), true); + writeField(_fMsg1, string("Plug MTMDK into a"), true); + writeField(_fMsg2, string("PC."), true); + writeField(_fMsg3, string(""), true); +} + +void LayoutConfig::update3of3() { + _timer.reset(); + _duration = 5000; + writeField(_fHeader, string("3 of 3"), true); + writeField(_fMsg1, string("Run com s/w on"), true); + writeField(_fMsg2, string("new TTY/COM at"), true); + writeField(_fMsg3, string("115200bps."), true); } diff --git a/Layout/LayoutConfig.h b/Layout/LayoutConfig.h index 0fdba1c..5a58433 100644 --- a/Layout/LayoutConfig.h +++ b/Layout/LayoutConfig.h @@ -9,12 +9,20 @@ class LayoutConfig : public Layout { ~LayoutConfig(); void display(); + void roll(); private: Label _lMode; - Label _lHelp1; - Label _lHelp2; - Label _lHelp3; + Field _fHeader; + Field _fMsg1; + Field _fMsg2; + Field _fMsg3; + Timer _timer; + uint8_t _screen; + uint32_t _duration; + void update1of3(); + void update2of3(); + void update3of3(); }; #endif diff --git a/Mode/ModeConfig.cpp b/Mode/ModeConfig.cpp index bd9e183..6fbeae0 100644 --- a/Mode/ModeConfig.cpp +++ b/Mode/ModeConfig.cpp @@ -143,7 +143,8 @@ bool ModeConfig::start() { //Run terminal session while (running) { - + _lc.roll(); + osEvent e = Thread::signal_wait(buttonSignal, 20); if (e.status == osEventSignal) { ButtonHandler::ButtonEvent _be = _buttons->getButtonEvent(); |