summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-11-11 14:24:49 -0600
committerMike Fiore <mfiore@multitech.com>2015-11-11 14:24:49 -0600
commit0bc27ddeae03930deb6106144b49e0614fe002da (patch)
tree1947f20d708343f1965ae12c21454f4f0fab224b
parent4e31ea44c166a59a273a51597c498c1367eeb38d (diff)
downloadmtdot-box-evb-factory-firmware-0bc27ddeae03930deb6106144b49e0614fe002da.tar.gz
mtdot-box-evb-factory-firmware-0bc27ddeae03930deb6106144b49e0614fe002da.tar.bz2
mtdot-box-evb-factory-firmware-0bc27ddeae03930deb6106144b49e0614fe002da.zip
add layout for startup screen, tweak main to display startup and sit in loop
-rw-r--r--Layout/LayoutStartup.cpp25
-rw-r--r--Layout/LayoutStartup.h23
-rw-r--r--main.cpp25
3 files changed, 62 insertions, 11 deletions
diff --git a/Layout/LayoutStartup.cpp b/Layout/LayoutStartup.cpp
new file mode 100644
index 0000000..c005b2f
--- /dev/null
+++ b/Layout/LayoutStartup.cpp
@@ -0,0 +1,25 @@
+#include "LayoutStartup.h"
+#include "MultiTech_Logo.h"
+#include "version.h"
+
+LayoutStartup::LayoutStartup(DOGS102* lcd)
+ : Layout(lcd),
+ _lName(0, 3, "MTDOT-BOX/EVB"),
+ _lInfo(0, 4, "Factory Firmware"),
+ _lVersion(0, 5, "Version"),
+ _fVersion(8, 5, 9),
+ _iLogo(0, 0, MultiTech_Logo)
+{}
+
+void LayoutStartup::display() {
+ clear();
+ startUpdate();
+
+ writeImage(_iLogo._col, _iLogo._row, _iLogo._bmp);
+ writeField(_lName._col, _lName._row, _lName._value);
+ writeField(_lInfo._col, _lInfo._row, _lInfo._value);
+ writeField(_lVersion._col, _lVersion._row, _lVersion._value);
+ writeField(_fVersion._col, _fVersion._row, MTDOT_BOX_VERSION, sizeof(MTDOT_BOX_VERSION));
+
+ endUpdate();
+}
diff --git a/Layout/LayoutStartup.h b/Layout/LayoutStartup.h
new file mode 100644
index 0000000..de8935e
--- /dev/null
+++ b/Layout/LayoutStartup.h
@@ -0,0 +1,23 @@
+#ifndef __LAYOUTSTARTUP_H__
+#define __LAYOUTSTARTUP_H__
+
+#include "Layout.h"
+
+class LayoutStartup : public Layout {
+ public:
+ LayoutStartup(DOGS102* lcd);
+ ~LayoutStartup();
+
+ void display();
+
+ private:
+ Label _lName;
+ Label _lInfo;
+ Label _lVersion;
+
+ Field _fVersion;
+
+ Image _iLogo;
+};
+
+#endif
diff --git a/main.cpp b/main.cpp
index dc78e52..2bf100d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,16 +1,20 @@
+// mbed headers
#include "mbed.h"
#include "rtos.h"
-
-#include "DOGS102.h"
+// MTS headers
+#include "mDot.h"
+#include "MTSLog.h"
+// sensor headers
#include "ISL29011.h"
#include "MMA845x.h"
#include "MPL3115A2.h"
-#include "NCP5623B.h"
#include "GPSPARSER.h"
-#include "DisplayManager.h"
-
-#include "mDot.h"
-#include "MTSLog.h"
+// display headers
+#include "DOGS102.h"
+#include "NCP5623B.h"
+#include "LayoutStartup.h"
+// misc heders
+#include <string>
// LCD and backlight controllers
SPI lcd_spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK);
@@ -19,7 +23,6 @@ DigitalOut lcd_spi_cs(SPI1_CS, 1);
DigitalOut lcd_cd(XBEE_ON_SLEEP, 1);
DOGS102* lcd;
NCP5623B* lcd_backlight;
-DisplayManager* display;
// Serial debug port
Serial debug(USBTX, USBRX);
@@ -30,10 +33,10 @@ int main() {
lcd = new DOGS102(lcd_spi, lcd_spi_cs, lcd_cd);
lcd_backlight = new NCP5623B(backlight_i2c);
- display = new DisplayManager(lcd);
-
logInfo("starting...");
- display->displaySplashScreen();
+
+ LayoutStartup ls(lcd);
+ ls.display();
while (true) {
logInfo("in loop");