The out-of-the-box demo application flashed on all display modules before they are shipped.

Dependencies:   DMBasicGUI DMSupport

This is the software that is flashed on the LPC4088 Display Modules before they are shipped from Embedded Artists.

Information

This project works on both the 4.3" and 5" display modules but requires different file systems to handle the different display resolutions.

For the 4.3" displays first drag-n-drop the media/fs_480_raw.fs5 (if you are using the new DAPLINK firmware use fs_480_raw.hex) file to the MBED drive and then drag-n-drop the demo itself. This way both the file system and software are up to date.

For the 5" displays first drag-n-drop the media/fs_800_raw.fsF (if you are using the new DAPLINK firmware use fs_800_raw.hex) file to the MBED drive and then drag-n-drop the demo itself. This way both the file system and software are up to date.

There is a prebuilt version of the demo binary here.

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

/media/uploads/embeddedartists/demo480_cap_000.png /media/uploads/embeddedartists/demo480_cap_001.png /media/uploads/embeddedartists/demo480_cap_002.png /media/uploads/embeddedartists/demo480_cap_004.png /media/uploads/embeddedartists/demo480_cap_006.png /media/uploads/embeddedartists/demo480_cap_007.png /media/uploads/embeddedartists/demo480_cap_008.png
The first slide from the Slideshow:
/media/uploads/embeddedartists/demo480_cap_003.png
A couple of images from the Image Viewer
/media/uploads/embeddedartists/demo480_cap_009.png /media/uploads/embeddedartists/demo480_cap_010.png

Revision:
5:6ca8470ba8f8
Parent:
4:a7cbb22e4348
--- a/main.cpp	Tue Apr 28 12:21:14 2015 +0000
+++ b/main.cpp	Tue Nov 05 09:11:36 2019 +0000
@@ -7,7 +7,6 @@
 #include "rtos.h"
 #include "EthernetInterface.h"
 #include "HTTPServer.h"
-#include "mbed_rpc.h"
 #include "USBHostMSD.h"
 #include "USBHostMouse.h"
 #include "USBHostKeyboard.h"
@@ -132,7 +131,7 @@
   }
 }
 
-void aliveTask(void const* args)
+void aliveTask(void)
 {
   DMBoard* board = &DMBoard::instance();
     
@@ -140,16 +139,16 @@
   {
     board->setLED(DMBoard::Led4, false);
     board->setLED(DMBoard::Led1, true);
-    Thread::wait(300);
+    ThisThread::sleep_for(300);
     board->setLED(DMBoard::Led1, false);
     board->setLED(DMBoard::Led2, true);
-    Thread::wait(300);
+    ThisThread::sleep_for(300);
     board->setLED(DMBoard::Led2, false);
     board->setLED(DMBoard::Led3, true);
-    Thread::wait(300);
+    ThisThread::sleep_for(300);
     board->setLED(DMBoard::Led3, false);
     board->setLED(DMBoard::Led4, true);
-    Thread::wait(300);
+    ThisThread::sleep_for(300);
   }
 }
 
@@ -239,7 +238,7 @@
 }
 
 #define SWIM_TASK_PREFIX  "[SWIM] "
-void swimTask(void const* args)
+void swimTask(void)
 {
   RtosLog* log = DMBoard::instance().logger();
   Display* disp = DMBoard::instance().display();
@@ -277,34 +276,30 @@
 
 #define NET_TASK_PREFIX  "[NET] "
 
-void netTask(void const* args)
+void netTask(void)
 {
   RtosLog* log = DMBoard::instance().logger();
   log->printf(NET_TASK_PREFIX"EthernetInterface Setting up...\r\n");
-  if(eth.init()!=0) {                             //for DHCP Server
-     //if(eth.init(IPAddress,NetMasks,Gateway)!=0) { //for Static IP Address
-     log->printf(NET_TASK_PREFIX"EthernetInterface Initialize Error \r\n");
-     mbed_die();
+  nsapi_error_t net_err = eth.connect();
+
+  if (net_err != NSAPI_ERROR_OK) {
+    log->printf(NET_TASK_PREFIX"EthernetInterface connect Error %d\r\n", net_err);
   }
-  while (eth.connect() != 0) {
-     Thread::wait(1000);
-  }
-  
-  ethInitialized = true;
-  ethUsingDHCP = true;
+  else {  
+    ethInitialized = true;
+    ethUsingDHCP = true;
   
-  log->printf(NET_TASK_PREFIX"IP Address is %s\r\n", eth.getIPAddress());
-  log->printf(NET_TASK_PREFIX"NetMask is %s\r\n", eth.getNetworkMask());
-  log->printf(NET_TASK_PREFIX"Gateway Address is %s\r\n", eth.getGateway());
-  log->printf(NET_TASK_PREFIX"Ethernet Setup OK\r\n");
+    log->printf(NET_TASK_PREFIX"IP Address is %s\r\n", eth.get_ip_address());
+    log->printf(NET_TASK_PREFIX"NetMask is %s\r\n", eth.get_netmask());
+    log->printf(NET_TASK_PREFIX"Gateway Address is %s\r\n", eth.get_gateway());
+    log->printf(NET_TASK_PREFIX"Ethernet Setup OK\r\n");
 
-  HTTPServerAddHandler<SimpleHandler>("/hello"); //Default handler
-  FSHandler::mount("/usb", "/");
-  HTTPServerAddHandler<FSHandler>("/");
-  //HTTPServerAddHandler<RPCHandler>("/rpc");
-  //lcd.locate(0,0);
-  //lcd.printf("%s",eth.getIPAddress());
-  HTTPServerStart(80);
+    HTTPServerAddHandler<SimpleHandler>("/hello"); //Default handler
+    FSHandler::mount("/mci", "/");
+    HTTPServerAddHandler<FSHandler>("/");
+
+    HTTPServerStart(80);
+  }
 }
 
 static volatile int8_t mouse_button, mouse_x, mouse_y, mouse_z;
@@ -460,13 +455,14 @@
 
 #define USB_TASK_PREFIX  "[USB] "
 #define USB_CONNECTION_EVENT   (1<<4)
-void usbTask(void const* args)
+void usbTask(void)
 {
   USBHostMSD* msd = new USBHostMSD("usb");
   USBHostKeyboard* keyboard = new USBHostKeyboard();
   USBHostMouse* mouse = new USBHostMouse();
   USBHost* host = USBHost::getHostInst();
-  host->signalOnConnections(Thread::gettid(), USB_CONNECTION_EVENT);
+  EventFlags connectionEvent;
+  host->signalOnConnections(&connectionEvent, USB_CONNECTION_EVENT);
 
   RtosLog* log = DMBoard::instance().logger();
     
@@ -476,7 +472,7 @@
 
   while (true) {
     // wait for connect/disconnect message from USBHost
-    Thread::signal_wait(USB_CONNECTION_EVENT);
+    connectionEvent.wait_any(USB_CONNECTION_EVENT);
     log->printf(USB_TASK_PREFIX"got USB event\n");
       
     if (msd->connected()) {
@@ -554,7 +550,7 @@
   if (err != DMBoard::Ok) {
     log->printf("Failed to initialize the board, got error %d\r\n", err);
     log->printf("\nTERMINATING\n");
-    wait_ms(2000); // allow RtosLog to flush messages
+    ThisThread::sleep_for(2000); // allow RtosLog to flush messages
     mbed_die();
   }
   
@@ -562,24 +558,28 @@
   prepareResources();
   
   board->buzzer(440,50);
-  wait_ms(30);
+  ThisThread::sleep_for(30);
   board->buzzer(660,50);
-  wait_ms(30);
+  ThisThread::sleep_for(30);
   board->buzzer(440,50);
   
   log->printf("\n\n---\nDemo flashed on new Display Modules.\nBuilt: " __DATE__ " at " __TIME__ "\n\n");
   
  
-  Thread tAlive(aliveTask);
+  Thread tAlive;
+  tAlive.start(aliveTask);
 #if defined(DM_BOARD_USE_DISPLAY)
-  Thread tSwim(swimTask, NULL, osPriorityNormal, 8192);
+  Thread tSwim(osPriorityNormal, 8192);
+  tSwim.start(swimTask);
 #endif  
-  Thread tNetwork(netTask, NULL, osPriorityNormal, 8192);
-  Thread tUSBHandler(usbTask, NULL, osPriorityNormal, 8192);
+  Thread tNetwork(osPriorityNormal, 8192);
+  tNetwork.start(netTask);
+  Thread tUSBHandler(osPriorityNormal, 8192);
+  tUSBHandler.start(usbTask);
   
   while(1) { 
     // Wait forever (in 1h increments) to prevent the tAlive, tSwim,
     // tNetwork and tUSBHandler thread from being garbage collected.
-    Thread::wait(3600*1000);
+    ThisThread::sleep_for(3600*1000);
   }
 }