Example using the application launcher.

Dependencies:   DMBasicGUI DMSupport

Example use of the AppLauncher class in the DMBasicGUI library.

This project is used in the TBD guide as a starting point when creating your own menu system. It can also be selected as a template when creating a new project based on the LPC4088 Display Module.

Information

This project works on both the 4.3" and 5" display modules.

This is what it looks like:

/media/uploads/embeddedartists/launcher_cap_000.png

If you click on the Something button:

/media/uploads/embeddedartists/launcher_cap_001.png

Files at this revision

API Documentation at this revision

Comitter:
embeddedartists
Date:
Mon Nov 04 15:12:28 2019 +0000
Parent:
3:f8a70ff53987
Commit message:
Updates related to mbed OS 5

Changed in this revision

AppTemplate.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
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/AppTemplate.cpp	Tue Apr 28 11:56:04 2015 +0000
+++ b/AppTemplate.cpp	Mon Nov 04 15:12:28 2019 +0000
@@ -103,7 +103,7 @@
     while(!done) {
       // wait for a new touch signal (signal is sent from AppLauncher,
       // which listens for touch events)
-      Thread::signal_wait(0x1);
+      ThisThread::flags_wait_all(0x1);
       if (touch->read(coord) == TouchPanel::TouchError_Ok) {
         
         // you can do something where with the touch event if you like
--- a/DMBasicGUI.lib	Tue Apr 28 11:56:04 2015 +0000
+++ b/DMBasicGUI.lib	Mon Nov 04 15:12:28 2019 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Embedded-Artists/code/DMBasicGUI/#1a7c743600e6
+http://developer.mbed.org/teams/Embedded-Artists/code/DMBasicGUI/#f0d00f29bfeb
--- a/DMSupport.lib	Tue Apr 28 11:56:04 2015 +0000
+++ b/DMSupport.lib	Mon Nov 04 15:12:28 2019 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Embedded-Artists/code/DMSupport/#e1cb4dd9bfeb
+http://developer.mbed.org/teams/Embedded-Artists/code/DMSupport/#bbfe299d4a0c
--- a/main.cpp	Tue Apr 28 11:56:04 2015 +0000
+++ b/main.cpp	Mon Nov 04 15:12:28 2019 +0000
@@ -50,7 +50,7 @@
   return a;
 }
 
-void guiTask(void const* args)
+void guiTask(void)
 {
   RtosLog* log = DMBoard::instance().logger();
     
@@ -87,18 +87,19 @@
   err = board->init();
   if (err != DMBoard::Ok) {
     log->printf("Failed to initialize the board, got error %d\r\n", err);
-    wait_ms(2000); // allow RtosLog to flush messages
+    ThisThread::sleep_for(2000); // allow RtosLog to flush messages
     mbed_die();
   }
   
   log->printf("\n\n---\nApplication Launcher Example\nBuilt: " __DATE__ " at " __TIME__ "\n\n");
 
-  Thread tGui(guiTask, NULL, osPriorityNormal, 8192);
+  Thread tGui(osPriorityNormal, 8192);
+  tGui.start(guiTask);
   
   while(1) { 
     // Wait forever (in 1h increments) to prevent the tGui
     // thread from being garbage collected.
-    Thread::wait(3600*1000);
+    ThisThread::sleep_for(3600*1000);
   }
 }