Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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:
Diff: main.cpp
- Revision:
- 23:3f8bc89e0b23
- Parent:
- 18:715f542538b3
- Child:
- 24:768f5958c308
--- a/main.cpp Mon Jan 26 10:15:05 2015 +0100 +++ b/main.cpp Mon Jan 26 14:48:37 2015 +0000 @@ -198,55 +198,6 @@ #endif //DM_BOARD_USE_DISPLAY -#define MSD_TASK_PREFIX "[MSD] " - -void msdTask(void const* args) -{ - usbInitGuard.lock(); - USBHostMSD* msd = new USBHostMSD("usb"); - usbInitGuard.unlock(); - USBHost* host = USBHost::getHostInst(); - RtosLog* log = DMBoard::instance().logger(); - - log->printf(MSD_TASK_PREFIX"msdTask started\n"); - - while(1) { - - log->printf(MSD_TASK_PREFIX"Attempting to connect...\n"); - - // try to connect a MSD device - bool connected = false; - do { - usbInitGuard.lock(); - connected = msd->connect(); - usbInitGuard.unlock(); - if (!connected) { - //log->printf(MSD_TASK_PREFIX"Failed to connect, waiting and trying again!\n"); - Thread::wait(500); - //DMBoard::instance().buzzer(440, 100); - } - } while(!connected); - - log->printf(MSD_TASK_PREFIX"Connected!\n"); - haveUSBMSD = true; - - // read a file - //readMessageFile(MSD_TASK_PREFIX); - - // if/when the device is disconnected, we try to connect it again - while(1) { - - Thread::wait(500); - - // if device disconnected, try to connect again - if (!msd->connected()) { - break; - } - } - haveUSBMSD = false; - log->printf(MSD_TASK_PREFIX"Disconnected\n"); - } -} #define NET_TASK_PREFIX "[NET] " @@ -409,46 +360,6 @@ } } -#define MOUSE_TASK_PREFIX "[MOUSE] " - -void mouseTask(void const* args) -{ - usbInitGuard.lock(); - USBHostMouse* mouse = new USBHostMouse(); - usbInitGuard.unlock(); - RtosLog* log = DMBoard::instance().logger(); - - log->printf(MOUSE_TASK_PREFIX"mouseTask started\n"); - - while(1) { - - prepareCursor(false); - log->printf(MOUSE_TASK_PREFIX"Attempting to connect...\n"); - - // try to connect a mouse - bool connected = false; - do { - usbInitGuard.lock(); - connected = mouse->connect(); - usbInitGuard.unlock(); - if (!connected) { - //log->printf(MOUSE_TASK_PREFIX"Failed to connect, waiting and trying again!\n"); - Thread::wait(500); - } - } while(!connected); - - log->printf(MOUSE_TASK_PREFIX"Connected!\n"); - mouse->attachEvent(mouseEvent); - prepareCursor(true); - - while(mouse->connected()) { - log->printf(MOUSE_TASK_PREFIX"Buttons: 0x%02x, X %3d, Y %3d, Z %3d\n", mouse_button, mouse_x, mouse_y, mouse_z); - Thread::wait(500); - } - - log->printf(MOUSE_TASK_PREFIX"Disconnected\n"); - } -} #define CIRCBUFF_SIZE 256 static uint8_t circbuff[CIRCBUFF_SIZE]; @@ -460,57 +371,6 @@ circbuff_write++; } -#define KEY_TASK_PREFIX "[KEY] " - -void keyTask(void const* args) -{ - usbInitGuard.lock(); - USBHostKeyboard* keyboard = new USBHostKeyboard(); - usbInitGuard.unlock(); - - RtosLog* log = DMBoard::instance().logger(); - uint8_t buff[10+1] = {0}; - int pos; - - log->printf(KEY_TASK_PREFIX"keyTask started\n"); - - while(1) { - - log->printf(KEY_TASK_PREFIX"Attempting to connect...\n"); - - // try to connect a keyboard - bool connected = false; - do { - usbInitGuard.lock(); - connected = keyboard->connect(); - usbInitGuard.unlock(); - if (!connected) { - //log->printf(KEY_TASK_PREFIX"Failed to connect, waiting and trying again!\n"); - Thread::wait(1000); - } - } while(!connected); - - log->printf(KEY_TASK_PREFIX"Connected!\n"); - keyboard->attach(keyEvent); - - while(keyboard->connected()) { - for (pos = 0; pos < 10; pos++) { - if (circbuff_read < circbuff_write) { - buff[pos++] = circbuff[circbuff_read%CIRCBUFF_SIZE]; - circbuff_read++; - } else { - break; - } - } - if (pos > 0) { - log->printf(KEY_TASK_PREFIX"%s\n", buff); - } - Thread::wait(20); - } - - log->printf(KEY_TASK_PREFIX"Disconnected\n"); - } -} #define USB_TASK_PREFIX "[USB] " #define USB_CONNECTION_EVENT (1<<4) @@ -708,10 +568,6 @@ log->printf("\n\n---\nMulti-threaded demo\nBuilt: " __DATE__ " at " __TIME__ "\n\n"); - //log->printf("Press button to start...\r\n"); - //while(!board->buttonPressed()); - //while(board->buttonPressed()); - //testRegistry(); @@ -719,13 +575,9 @@ #if defined(DM_BOARD_USE_DISPLAY) Thread tSwim(swimTask, NULL, osPriorityNormal, 8192); #endif - //Thread tMemstick(msdTask, NULL, osPriorityNormal, 8192); Thread tNetwork(netTask, NULL, osPriorityNormal, 8192); - //Thread tMouse(mouseTask); - //Thread tKeyboard(keyTask); Thread tUSBHandler(usbTask, NULL, osPriorityNormal, 8192); - //while(1) { wait(5); } while(1) { wait(5); time_t seconds = time(NULL);