Example using the support package for LPC4088 DisplayModule

Dependencies:   DMBasicGUI DMSupport

Example using a lot of the features in the software package for the LPC4088 Display Module.

This project can be selected as a template when creating a new project based on the LPC4088 Display Module.

Information

This project works on the 4.3" display modules.

Some of the apps works on the 5" display modules. The ImageViewer and Slideshow app will show the images distorted as it does not take the resolution into consideration.

Information

The USB Status app is disabled. The Image viewer looks for images in the root of SD cards, USB memory sticks or the file system on the QSPI flash. The Slideshow app expects to find a slideshow script in /mci/elec14/ea_logo.txt.

This is what it looks like on the 4.3" display:

/media/uploads/embeddedartists/everything_cap_000.png /media/uploads/embeddedartists/everything_cap_001.png /media/uploads/embeddedartists/everything_cap_003.png /media/uploads/embeddedartists/everything_cap_004.png /media/uploads/embeddedartists/everything_cap_006.png /media/uploads/embeddedartists/everything_cap_008.png

Files at this revision

API Documentation at this revision

Comitter:
embeddedartists
Date:
Tue Feb 17 10:46:06 2015 +0100
Parent:
23:3f8bc89e0b23
Child:
25:8bef7b849338
Commit message:
- Modified AppRTCSettings to use current time when initializing
- Added AppDraw to show off multitouch (works with single touch as well)
- Replaced wait with Thread::wait in main()
- Moved the ok/cancel button data into DMBasicGUI, overridable with
DM_BOARD_USE_BUILTIN_IMAGES
- Updated the DM_Support library (see version history there for changes)
- Updated the DM_BasicGUI library (see version history there for changes)
- Added texts to the icons in the launcher

Changed in this revision

AppDraw.cpp Show annotated file Show diff for this revision Revisions of this file
AppDraw.h Show annotated file Show diff for this revision Revisions of this file
AppImageViewer.cpp Show annotated file Show diff for this revision Revisions of this file
AppRTCSettings.cpp Show annotated file Show diff for this revision Revisions of this file
DMBasicGUI.lib Show annotated file Show diff for this revision Revisions of this file
DMSupport.lib Show annotated file Show diff for this revision Revisions of this file
dm_board_config.h Show annotated file Show diff for this revision Revisions of this file
image_data.c Show annotated file Show diff for this revision Revisions of this file
image_data.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AppDraw.cpp	Tue Feb 17 10:46:06 2015 +0100
@@ -0,0 +1,149 @@
+/*
+ *  Copyright 2014 Embedded Artists AB
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "AppDraw.h"
+#include "lpc_swim_font.h"
+#include "lpc_colors.h"
+#include "image_data.h"
+
+/******************************************************************************
+ * Defines and typedefs
+ *****************************************************************************/
+ 
+#define BOX_SIDE   192 //256
+ 
+#define BTN_WIDTH  65
+#define BTN_HEIGHT 40
+#define BTN_OFF    20
+
+/******************************************************************************
+ * Local variables
+ *****************************************************************************/
+
+static const COLOR_T COLORS[] = {
+  RED,
+  GREEN,
+  BLUE,
+  CYAN,
+  MAGENTA,
+  YELLOW,
+  BLACK,
+};
+
+/******************************************************************************
+ * Private functions
+ *****************************************************************************/
+
+static void buttonClicked(uint32_t x)
+{
+  bool* done = (bool*)x;
+  *done = true;
+}
+
+void AppDraw::draw()
+{
+    // Prepare fullscreen
+    swim_window_open(_win, 
+                   _disp->width(), _disp->height(),         // full size
+                   (COLOR_T*)_fb,
+                   0,0,_disp->width()-1, _disp->height()-1, // window position and size
+                   0,                                       // border
+                   WHITE, WHITE, BLACK);                    // colors: pen, backgr, forgr
+    
+    _btn = new ImageButton(_win->fb, _win->xpmax - BTN_OFF - BTN_WIDTH, _win->ypmax - BTN_OFF - BTN_HEIGHT, BTN_WIDTH, BTN_HEIGHT);
+    _btn->loadImages(img_ok, img_size_ok);
+    _btn->draw();
+}
+
+/******************************************************************************
+ * Public functions
+ *****************************************************************************/
+
+AppDraw::AppDraw() : _disp(NULL), _win(NULL), _fb(NULL), _btn(NULL)
+{
+}
+
+AppDraw::~AppDraw()
+{
+    teardown();
+}
+
+bool AppDraw::setup()
+{
+    _disp = DMBoard::instance().display();
+    _win = (SWIM_WINDOW_T*)malloc(sizeof(SWIM_WINDOW_T));
+    _fb = _disp->allocateFramebuffer();
+
+    return (_win != NULL && _fb != NULL);
+}
+
+void AppDraw::runToCompletion()
+{
+    // Alternative 1: use the calling thread's context to run in
+    bool done = false;
+    draw();
+    _btn->setAction(buttonClicked, (uint32_t)&done);
+    void* oldFB = _disp->swapFramebuffer(_fb);
+    
+    // Wait for touches
+    TouchPanel* touch = DMBoard::instance().touchPanel();
+    bool ignore;
+    int fingers = 0;
+    touch->info(&ignore, &fingers, &ignore);
+    if (fingers > MaxSupportedFingers) {
+        fingers = MaxSupportedFingers;
+    }
+    while(!done) {
+      // wait for a new touch signal (signal is sent from AppLauncher,
+      // which listens for touch events)
+      Thread::signal_wait(0x1);
+      if (touch->read(_coords, fingers) == TouchPanel::TouchError_Ok) {
+        for (int i = 0; i < fingers; i++) {
+          if (_coords[i].z > 0) {
+            _win->pen = COLORS[i];
+            swim_put_circle(_win, _coords[i].x, _coords[i].y, 2, 1);
+          }
+        }
+        if (_btn->handle(_coords[0].x, _coords[0].y, _coords[0].z > 0)) {
+            _btn->draw();
+        }
+      }
+    }
+    
+    // User has clicked the button, restore the original FB
+    _disp->swapFramebuffer(oldFB);
+    swim_window_close(_win);
+}
+
+bool AppDraw::teardown()
+{
+    if (_win != NULL) {
+        free(_win);
+        _win = NULL;
+    }
+    if (_fb != NULL) {
+        free(_fb);
+        _fb = NULL;
+    }
+    if (_btn != NULL) {
+        delete _btn;
+        _btn = NULL;
+    }
+    return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AppDraw.h	Tue Feb 17 10:46:06 2015 +0100
@@ -0,0 +1,55 @@
+/*
+ *  Copyright 2014 Embedded Artists AB
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef APP_DRAW_H
+#define APP_DRAW_H
+
+#include "App.h"
+#include "DMBoard.h"
+#include "lpc_swim.h"
+#include "ImageButton.h"
+
+/**
+ * An App example. Lets the user draw on the screen. Each finger is 
+ * assigned it's own color.
+ *
+ * The purpose of this example is to show the use of a multitouch
+ * display.
+ */
+class AppDraw : public App {
+public:
+
+	AppDraw();
+	virtual ~AppDraw();
+
+    virtual bool setup();
+    virtual void runToCompletion();
+    virtual bool teardown();
+
+private:
+    enum Constants {
+        MaxSupportedFingers = 5,
+    };
+    Display* _disp;
+    SWIM_WINDOW_T* _win;
+    void* _fb;
+    ImageButton* _btn;
+    touch_coordinate_t _coords[MaxSupportedFingers];
+
+    void draw();
+};
+
+#endif
--- a/AppImageViewer.cpp	Mon Jan 26 14:48:37 2015 +0000
+++ b/AppImageViewer.cpp	Tue Feb 17 10:46:06 2015 +0100
@@ -188,7 +188,7 @@
         }
         _win->fb = fb;
         Image::ImageData_t* data = (Image::ImageData_t*)evt.value.p;
-        swim_put_scale_image(_win, (COLOR_T*)data->pixels, data->width, data->height);
+        swim_put_image_xy(_win, (COLOR_T*)data->pixels, data->width, data->height, _disp->width()-data->width, _disp->height()-data->height);
         free(data->pointerToFree);
         _mailbox.free(data);
         if (first) {
--- a/AppRTCSettings.cpp	Mon Jan 26 14:48:37 2015 +0000
+++ b/AppRTCSettings.cpp	Tue Feb 17 10:46:06 2015 +0100
@@ -251,12 +251,18 @@
   for (int i = 0; i < NumButtons; i++) {
     _buttons[i] = NULL;
   }
-  _values[ButtonYear] = 2015;
-  _values[ButtonMonth] = 1;
-  _values[ButtonDay] = 17;
-  _values[ButtonHour] = 14;
-  _values[ButtonMinute] = 46;
-  _values[ButtonSecond] = 0;
+  time_t rawtime;
+  struct tm * timeinfo;
+
+  time (&rawtime);
+  timeinfo = localtime (&rawtime);
+  
+  _values[ButtonYear] = timeinfo->tm_year + 1900;
+  _values[ButtonMonth] = timeinfo->tm_mon + 1;
+  _values[ButtonDay] = timeinfo->tm_mday;
+  _values[ButtonHour] = timeinfo->tm_hour;
+  _values[ButtonMinute] = timeinfo->tm_min;
+  _values[ButtonSecond] = timeinfo->tm_sec;
   
   _digitImage.pointerToFree = NULL;
   
--- a/DMBasicGUI.lib	Mon Jan 26 14:48:37 2015 +0000
+++ b/DMBasicGUI.lib	Tue Feb 17 10:46:06 2015 +0100
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/embeddedartists/code/DMBasicGUI/#651861441108
+http://developer.mbed.org/users/embeddedartists/code/DMBasicGUI/#265884fa7fdd
--- a/DMSupport.lib	Mon Jan 26 14:48:37 2015 +0000
+++ b/DMSupport.lib	Tue Feb 17 10:46:06 2015 +0100
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/embeddedartists/code/DMSupport/#a97015441bb4
+http://developer.mbed.org/users/embeddedartists/code/DMSupport/#d47cffcb0a3e
--- a/dm_board_config.h	Mon Jan 26 14:48:37 2015 +0000
+++ b/dm_board_config.h	Tue Feb 17 10:46:06 2015 +0100
@@ -33,5 +33,6 @@
 // #define DM_BOARD_ENABLE_MEASSURING_PINS
 // #define DM_BOARD_BIOS_DEVELOPMENT
 #define DM_BOARD_USE_REGISTRY
+#define DM_BOARD_USE_BUILTIN_IMAGES
 
 #endif
--- a/image_data.c	Mon Jan 26 14:48:37 2015 +0000
+++ b/image_data.c	Tue Feb 17 10:46:06 2015 +0100
@@ -2279,90 +2279,6 @@
 };
 const unsigned int img_size_numbers = sizeof(img_numbers);
 
-const unsigned char img_ok[] = {
-	0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52, 
-	0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x28,0x08,0x02,0x00,0x00,0x00,0x03,0x9C,0x2F, 
-	0x3A,0x00,0x00,0x00,0x01,0x73,0x52,0x47,0x42,0x00,0xAE,0xCE,0x1C,0xE9,0x00,0x00, 
-	0x00,0x04,0x67,0x41,0x4D,0x41,0x00,0x00,0xB1,0x8F,0x0B,0xFC,0x61,0x05,0x00,0x00, 
-	0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0E,0xC3,0x00,0x00,0x0E,0xC3,0x01,0xC7, 
-	0x6F,0xA8,0x64,0x00,0x00,0x01,0xE1,0x49,0x44,0x41,0x54,0x58,0x47,0xED,0x92,0xCB, 
-	0x4A,0xC3,0x40,0x14,0x86,0xFB,0x42,0x0A,0xDD,0xB8,0x10,0xDC,0xB9,0xF2,0x11,0xDC, 
-	0x0A,0x22,0x22,0xDD,0x74,0xE1,0x42,0x70,0x2B,0x0A,0xDE,0x10,0x41,0xD1,0x55,0x51, 
-	0x4A,0x57,0x56,0x11,0x45,0xBC,0x80,0xE0,0x05,0x15,0x04,0x41,0x45,0xD1,0x85,0xE0, 
-	0x23,0x68,0x9A,0x26,0x93,0xA6,0x06,0x73,0xE6,0x27,0x9E,0xCC,0x24,0xAD,0x49,0x83, 
-	0x0B,0x7F,0xBE,0x45,0x66,0xE6,0x9F,0xF3,0xC1,0x90,0x5C,0xEE,0x24,0xDF,0x12,0xC7, 
-	0xA1,0x9D,0x84,0xF0,0x75,0x66,0xF0,0x75,0x66,0xE0,0xAB,0xD7,0x18,0xCE,0x00,0xE8, 
-	0xFE,0xC5,0x9D,0x06,0xBA,0x44,0xE2,0x7E,0xA3,0xD0,0x67,0x8C,0xF4,0x18,0x43,0x6C, 
-	0x3F,0x02,0xE8,0x12,0x89,0x07,0xCC,0x22,0xDB,0x89,0x05,0xBA,0x4E,0x3D,0xF5,0xA8, 
-	0x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,0x90,0x2D,0x71,0xCA,0xAE,0xEB,0x80,0x4E,0x2B,0xF6,0xA1,0xC1, 
-	0x71,0xA9,0xA6,0x2E,0xF6,0xB8,0x75,0x9E,0x69,0xBC,0x3E,0x7B,0xE2,0x82,0xDD,0xD2, 
-	0x01,0x5D,0xBC,0xD8,0x87,0x0C,0x9A,0x1C,0x89,0x1B,0xD6,0xD7,0x01,0x5D,0xAB,0x62, 
-	0x0F,0x92,0xA8,0x92,0xE6,0xCF,0xA5,0x84,0x3C,0xA1,0x54,0xAC,0x23,0xD6,0xD4,0x01, 
-	0x5D,0x7B,0xE2,0xC1,0xDA,0x24,0xA9,0x7E,0x66,0xC2,0x5C,0x61,0x4D,0x1D,0xD0,0xB5, 
-	0x27,0xF6,0xB8,0x16,0x8F,0x64,0x0B,0x84,0x75,0x22,0x80,0xAE,0x6D,0xB1,0x07,0xD9, 
-	0x64,0xC6,0xCD,0x65,0x56,0x88,0x00,0xBA,0x44,0xE2,0xF9,0x7A,0x99,0x1D,0xC5,0x02, 
-	0xDD,0x6F,0xC4,0x49,0x80,0xEE,0x5F,0xDC,0x69,0xA0,0xFB,0x03,0xE2,0xAC,0xE1,0xEB, 
-	0xCC,0xE0,0xEB,0x6C,0x38,0xC9,0x7F,0x01,0x57,0x74,0xDC,0x0C,0x35,0x64,0x6D,0xA8, 
-	0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82
-};
-const unsigned int img_size_ok = sizeof(img_ok);
-
-const unsigned char img_cancel[] = {
-	0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52, 
-	0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x28,0x08,0x02,0x00,0x00,0x00,0x03,0x9C,0x2F, 
-	0x3A,0x00,0x00,0x00,0x01,0x73,0x52,0x47,0x42,0x00,0xAE,0xCE,0x1C,0xE9,0x00,0x00, 
-	0x00,0x04,0x67,0x41,0x4D,0x41,0x00,0x00,0xB1,0x8F,0x0B,0xFC,0x61,0x05,0x00,0x00, 
-	0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0E,0xC3,0x00,0x00,0x0E,0xC3,0x01,0xC7, 
-	0x6F,0xA8,0x64,0x00,0x00,0x01,0xF8,0x49,0x44,0x41,0x54,0x58,0x47,0xED,0xD8,0x3D, 
-	0x6B,0xC2,0x50,0x18,0x05,0x60,0x13,0x13,0x93,0x76,0xF5,0x1F,0x74,0x11,0x1C,0x74, 
-	0x73,0x2D,0x1D,0xBA,0xB6,0x85,0xB6,0x8A,0x51,0x04,0x1D,0x1C,0x85,0x0E,0x5D,0x0A, 
-	0x45,0xEC,0x60,0x71,0x72,0x2F,0xD4,0xA1,0x9B,0x58,0x8A,0xBA,0x76,0x72,0xED,0x26, 
-	0xFE,0x8B,0x2E,0x05,0x11,0x12,0x3F,0xE2,0xED,0x6D,0x72,0xD2,0x26,0x7E,0xE5,0x0A, 
-	0x36,0x52,0xEA,0x33,0xE8,0x79,0x83,0x78,0xC2,0x8D,0x31,0x51,0xAE,0xE5,0xDB,0x0E, 
-	0x1E,0xCF,0x9E,0xDB,0x5A,0xF1,0xCF,0x52,0x1F,0x9F,0x9E,0x22,0xFD,0xA6,0xD7,0x16, 
-	0x0A,0xFF,0xDF,0x52,0xEF,0x8A,0x3D,0xF3,0x47,0x8A,0xC5,0x48,0x04,0x69,0x11,0xE1, 
-	0xF2,0xD2,0x7F,0x72,0x82,0xC1,0x0D,0x6B,0xB1,0xA4,0x28,0x72,0xBD,0x2E,0xDC,0xDD, 
-	0x49,0x37,0x37,0xD8,0x64,0x23,0x5E,0x5D,0xED,0x35,0x9B,0x62,0x2A,0x15,0xC8,0xE5, 
-	0xB0,0xC9,0x0D,0x53,0xB1,0x5C,0xA9,0xF0,0xF1,0x38,0x27,0x49,0x34,0xF3,0xB1,0x58, 
-	0x20,0x9D,0x36,0xB7,0x9B,0x68,0xA5,0x70,0x78,0x68,0x66,0x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E, 
-	0x2D,0x23,0x19,0x88,0xAE,0x23,0x59,0xE4,0x72,0x19,0xC9,0xCD,0x1A,0xC5,0x33,0xAD, 
-	0x6A,0x32,0xA9,0x9D,0x9F,0x63,0xB0,0x91,0x9D,0x2F,0x5B,0x86,0xB5,0x58,0x6E,0x34, 
-	0x90,0x0C,0xEA,0xD9,0x99,0x4F,0x55,0x11,0x9C,0x38,0xBA,0xE6,0x0C,0x67,0x17,0x6B, 
-	0xF1,0xF7,0xA9,0x35,0xE9,0x74,0x66,0xCA,0xF4,0xB7,0x37,0x24,0x4B,0x40,0x51,0x90, 
-	0x96,0xDB,0xCC,0x0D,0xFD,0xCC,0x51,0x18,0x3D,0x3D,0xE9,0xCE,0xCB,0xE5,0xB7,0x0D, 
-	0xDF,0xD0,0xAB,0x85,0x02,0x12,0xBD,0x9A,0x3D,0x3C,0x2C,0x6B,0xB5,0xDB,0xFD,0x84, 
-	0xF1,0xCC,0xAE,0xD8,0x33,0x5B,0x2B,0xDE,0xFD,0xF9,0xE2,0x11,0x9F,0xEF,0x13,0x73, 
-	0x58,0x88,0xAC,0x57,0x96,0x5C,0x12,0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE, 
-	0x42,0x60,0x82
-};
-const unsigned int img_size_cancel = sizeof(img_cancel);
-
 const unsigned char img_preferences_system_network[] = {
 	0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52, 
 	0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x40,0x08,0x06,0x00,0x00,0x00,0xAA,0x69,0x71, 
--- a/image_data.h	Mon Jan 26 14:48:37 2015 +0000
+++ b/image_data.h	Tue Feb 17 10:46:06 2015 +0100
@@ -1,3 +1,5 @@
+#include "basic_image_data.h"
+
 extern const unsigned char img_arrow_down[];
 extern const unsigned int img_size_arrow_down;
 
@@ -40,12 +42,6 @@
 extern const unsigned char img_numbers[];
 extern const unsigned int img_size_numbers;
 
-extern const unsigned char img_ok[];
-extern const unsigned int img_size_ok;
-
-extern const unsigned char img_cancel[];
-extern const unsigned int img_size_cancel;
-
 extern const unsigned char img_preferences_system_network[];
 extern const unsigned int img_size_preferences_system_network;
 
--- a/main.cpp	Mon Jan 26 14:48:37 2015 +0000
+++ b/main.cpp	Tue Feb 17 10:46:06 2015 +0100
@@ -24,6 +24,8 @@
 #include "AppImageViewer.h"
 #include "AppSlideShow.h"
 #include "AppRTCSettings.h"
+//#include "AppUSBStatus.h"
+#include "AppDraw.h"
 #include "image_data.h"
 
 
@@ -82,41 +84,6 @@
   }
 }
 
-/*
- * Reads the /message.txt file from the file system and prints the content
- */
-void readMessageFile(const char* prefix)
-{
-  RtosLog* log = DMBoard::instance().logger();
-  log->printf("%sTesting to read from USB\n", prefix);
-    
-  FILE * fp = fopen("/usb/message.txt", "r");
-  
-  if (fp != NULL) {
-    uint8_t* buff = (uint8_t*)malloc(1024+1);
-    if (buff == NULL) {
-      log->printf("%sFailed to allocate memory for test\n", prefix);
-    } else {
-      int num = fread(buff, 1, 1024, fp);
-      if (num <= 0) {
-        log->printf("%sUnable to read file, got %d as result\n", prefix, num);
-      } else if (num < 1024) {
-        log->printf("%sHave read all %d bytes in the file:\n---\n", prefix, num);
-        buff[num] = '\0';
-        log->printf((const char*)buff);
-        log->printf("\n---\n");
-      } else {
-        log->printf("%sHave read %d bytes with more to read\n", prefix, num);
-      }
-      free(buff);
-    }
-    fclose(fp);
-  } else {
-    log->printf("%sFILE == NULL\r\n", prefix);
-  }
-}
-
-
 #if defined(DM_BOARD_USE_DISPLAY)
 
 typedef enum {
@@ -127,6 +94,8 @@
     StatusApp, 
     TouchTestApp,
     RtcApp,
+    USBStatusApp,
+    DrawingApp,
     CalibrationApp =  AppLauncher::CalibrationApp,
     Placeholder,
 } myapps_t;
@@ -148,7 +117,7 @@
           a = new AppImageViewer();
           break;
       case SlideshowApp:
-          a = new AppSlideShow();
+          a = new AppSlideShow("/mci/elec14/ea_logo.txt", "/mci/elec14", 0, 0);
           break;
       case StatusApp:
           a = new AppStatus();
@@ -156,6 +125,12 @@
       case RtcApp:
           a = new AppRTCSettings();
           break;
+      case USBStatusApp:
+          //a = new AppUSBStatus();
+          break;
+      case DrawingApp:
+          a = new AppDraw();
+          break;
       default:
           break;
   }
@@ -173,16 +148,16 @@
     
     
   if (launcher.setup()) {
-    launcher.addImageButton(SettingsApp,  img_preferences_system_network, img_size_preferences_system_network);
-    launcher.addImageButton(Placeholder, img_bijiben, img_size_bijiben);
-    launcher.addImageButton(SlideshowApp, img_multimedia_photo_manager, img_size_multimedia_photo_manager);
+    launcher.addImageButton(SettingsApp, "Network", WHITE,  img_preferences_system_network, img_size_preferences_system_network);
+    launcher.addImageButton(DrawingApp, "Drawing", WHITE, img_bijiben, img_size_bijiben);
+    launcher.addImageButton(SlideshowApp, "Slideshow", WHITE, img_multimedia_photo_manager, img_size_multimedia_photo_manager);
     //launcher.addImageButton(TouchGFXApp,  "TouchGFX");
     //launcher.addImageButton(EmWinApp,     "emWin");
-    launcher.addImageButton(ColorPickerApp,  img_preferences_color, img_size_preferences_color);
-    launcher.addImageButton(ImageViewerApp,  img_multimedia_photo_manager, img_size_multimedia_photo_manager);
-    launcher.addImageButton(StatusApp,  img_utilities_system_monitor, img_size_utilities_system_monitor);
-    launcher.addImageButton(Placeholder,  img_unetbootin, img_size_unetbootin);
-    launcher.addImageButton(RtcApp,  img_preferences_system_time, img_size_preferences_system_time);
+    launcher.addImageButton(ColorPickerApp, "Color Picker", WHITE,  img_preferences_color, img_size_preferences_color);
+    launcher.addImageButton(ImageViewerApp, "Image Viewer", WHITE,  img_multimedia_photo_manager, img_size_multimedia_photo_manager);
+    launcher.addImageButton(StatusApp, "About", WHITE,  img_utilities_system_monitor, img_size_utilities_system_monitor);
+    launcher.addImageButton(Placeholder, "USB Status", WHITE,  img_unetbootin, img_size_unetbootin);
+    launcher.addImageButton(RtcApp, "Clock", WHITE,  img_preferences_system_time, img_size_preferences_system_time);
       
     launcher.setAppCreatorFunc(launchApp);
     log->printf(SWIM_TASK_PREFIX"Starting menu system\n");
@@ -231,7 +206,7 @@
   HTTPServerStart(80);
 }
 
-static int8_t mouse_button, mouse_x, mouse_y, mouse_z;
+static volatile int8_t mouse_button, mouse_x, mouse_y, mouse_z;
 static uint16_t cursor_x=0, cursor_y=0;
 void mouseEvent(uint8_t buttons, int8_t x, int8_t y, int8_t z)
 {
@@ -362,8 +337,8 @@
 
 
 #define CIRCBUFF_SIZE 256
-static uint8_t circbuff[CIRCBUFF_SIZE];
-static uint32_t circbuff_read = 0;
+static volatile uint8_t circbuff[CIRCBUFF_SIZE];
+static volatile uint32_t circbuff_read = 0;
 static uint32_t circbuff_write = 0;
 void keyEvent(uint8_t key)
 {
@@ -579,7 +554,7 @@
   Thread tUSBHandler(usbTask, NULL, osPriorityNormal, 8192);
   
   while(1) { 
-    wait(5); 
+    Thread::wait(5000); 
     time_t seconds = time(NULL);
     log->printf("Time: %s\n", ctime(&seconds));
   }