Demo for Embedded World 2015.
Dependencies: DMBasicGUI DMSupport
Demo running on several LPC4088 Display Modules on the Embedded World 2015 exhibition.
Information
To run the demo first drag-n-drop the to_sync.fs3 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.
This is what the launcher will look like:
Diff: AppLauncherSpecial.cpp
- Revision:
- 1:1a01ef434a72
- Parent:
- 0:6bd24cbb88a1
--- a/AppLauncherSpecial.cpp Thu Feb 19 13:54:53 2015 +0000 +++ b/AppLauncherSpecial.cpp Tue Nov 05 08:20:16 2019 +0000 @@ -161,16 +161,20 @@ // Render the current time in the upper right corner once every second bool updateClock = false; - RtosTimer updateClockTimer(onTimeoutEvent, osTimerPeriodic, &updateClock); - updateClockTimer.start(1000); + //RtosTimer updateClockTimer(onTimeoutEvent, osTimerPeriodic, &updateClock); + //updateClockTimer.start(1000); + EventQueue updateClockTimer(4*EVENTS_EVENT_SIZE); + int updateClockTimerId = updateClockTimer.call_in(1000, onTimeoutEvent, &updateClock); // To keep track of the button pushes bool buttonPressed = false; bool buttonTimeout = false; InterruptIn button(P2_10); - button.rise(this, &AppLauncherSpecial::onButtonEvent); - button.fall(this, &AppLauncherSpecial::onButtonEvent); - RtosTimer buttonTimer(onTimeoutEvent, osTimerOnce, &buttonTimeout); + button.rise(callback(this, &AppLauncherSpecial::onButtonEvent)); + button.fall(callback(this, &AppLauncherSpecial::onButtonEvent)); + + EventQueue buttonTimer(4*EVENTS_EVENT_SIZE); + int buttonTimerId = buttonTimer.call_in(2000, onTimeoutEvent, &buttonTimeout); // To prevent the "exit" click of a launched application to launch // a new application. This could happen on a multitouch display if @@ -181,15 +185,15 @@ // Wait for touches TouchPanel* touch = board->touchPanel(); - FunctionPointer* fpOld = touch->setListener(new FunctionPointer(this, &AppLauncherSpecial::onTouchEvent)); + touch->setListener(callback(this, &AppLauncherSpecial::onTouchEvent)); touch_coordinate_t coord; while (true) { - Thread::signal_wait(APP_SIGID_TOUCH); + ThisThread::flags_wait_all(APP_SIGID_TOUCH); if (_newTouchEvent) { if (buttonPressed) { // cancel buttonPressed = false; - buttonTimer.stop(); + buttonTimer.cancel(buttonTimerId); } _newTouchEvent = false; if (touch->read(coord) != TouchPanel::TouchError_Ok) { @@ -214,10 +218,10 @@ _newButtonEvent = false; if (board->buttonPressed()) { buttonPressed = true; - buttonTimer.start(2000); + buttonTimer.dispatch(0); } else { buttonPressed = false; - buttonTimer.stop(); + buttonTimer.cancel(buttonTimerId); } continue; } else if (updateClock) { @@ -249,9 +253,6 @@ } } - // restore old touch listener (get our listener in return) - fpOld = touch->setListener(fpOld); - delete fpOld; } bool AppLauncherSpecial::teardown()