Port of the LPC4088 QSB EA LCD Sphere Demo to the LPC4088 DM using the DMSupport lib. Dropping the QSB EALib
Dependencies: DMBasicGUI DMSupport
Fork of lpc4088_displaymodule_hello_world by
Just a quick hack to get something good looking on the LPC4088DM
/media/uploads/tecnosys/lpc4088dm.jpg
main.cpp@5:d2f1c9185c5b, 2015-04-29 (annotated)
- Committer:
- tecnosys
- Date:
- Wed Apr 29 05:34:03 2015 +0000
- Revision:
- 5:d2f1c9185c5b
- Parent:
- 0:8ef5f57e33dc
initial port of EA LCD Demo to DMSupport libs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 0:8ef5f57e33dc | 1 | #include "mbed.h" |
embeddedartists | 0:8ef5f57e33dc | 2 | #include "DMBoard.h" |
tecnosys | 5:d2f1c9185c5b | 3 | //#include "lpc_swim.h" |
tecnosys | 5:d2f1c9185c5b | 4 | //#include "lpc_swim_font.h" |
tecnosys | 5:d2f1c9185c5b | 5 | #include "SphereDemo.h" |
tecnosys | 5:d2f1c9185c5b | 6 | |
tecnosys | 5:d2f1c9185c5b | 7 | bool abortTest; |
embeddedartists | 0:8ef5f57e33dc | 8 | |
embeddedartists | 0:8ef5f57e33dc | 9 | int main() |
embeddedartists | 0:8ef5f57e33dc | 10 | { |
tecnosys | 5:d2f1c9185c5b | 11 | |
embeddedartists | 0:8ef5f57e33dc | 12 | DMBoard::BoardError err; |
embeddedartists | 0:8ef5f57e33dc | 13 | DMBoard* board = &DMBoard::instance(); |
embeddedartists | 0:8ef5f57e33dc | 14 | RtosLog* log = board->logger(); |
embeddedartists | 0:8ef5f57e33dc | 15 | Display* disp = board->display(); |
tecnosys | 5:d2f1c9185c5b | 16 | abortTest=false; |
embeddedartists | 0:8ef5f57e33dc | 17 | |
embeddedartists | 0:8ef5f57e33dc | 18 | do { |
embeddedartists | 0:8ef5f57e33dc | 19 | err = board->init(); |
embeddedartists | 0:8ef5f57e33dc | 20 | if (err != DMBoard::Ok) { |
embeddedartists | 0:8ef5f57e33dc | 21 | log->printf("Failed to initialize the board, got error %d\r\n", err); |
embeddedartists | 0:8ef5f57e33dc | 22 | break; |
embeddedartists | 0:8ef5f57e33dc | 23 | } |
embeddedartists | 0:8ef5f57e33dc | 24 | |
tecnosys | 5:d2f1c9185c5b | 25 | //log->printf("\n\nHello World!\n\n"); |
embeddedartists | 0:8ef5f57e33dc | 26 | |
tecnosys | 5:d2f1c9185c5b | 27 | // SWIM_WINDOW_T win; |
embeddedartists | 0:8ef5f57e33dc | 28 | void* fb = disp->allocateFramebuffer(); |
embeddedartists | 0:8ef5f57e33dc | 29 | if (fb == NULL) { |
embeddedartists | 0:8ef5f57e33dc | 30 | log->printf("Failed to allocate memory for a frame buffer\r\n"); |
embeddedartists | 0:8ef5f57e33dc | 31 | err = DMBoard::MemoryError; |
embeddedartists | 0:8ef5f57e33dc | 32 | break; |
embeddedartists | 0:8ef5f57e33dc | 33 | } |
embeddedartists | 0:8ef5f57e33dc | 34 | |
tecnosys | 5:d2f1c9185c5b | 35 | |
embeddedartists | 0:8ef5f57e33dc | 36 | // Start display in default mode (16-bit) |
embeddedartists | 0:8ef5f57e33dc | 37 | Display::DisplayError disperr = disp->powerUp(fb); |
embeddedartists | 0:8ef5f57e33dc | 38 | if (disperr != Display::DisplayError_Ok) { |
embeddedartists | 0:8ef5f57e33dc | 39 | log->printf("Failed to initialize the display, got error %d\r\n", disperr); |
embeddedartists | 0:8ef5f57e33dc | 40 | break; |
embeddedartists | 0:8ef5f57e33dc | 41 | } |
tecnosys | 5:d2f1c9185c5b | 42 | |
tecnosys | 5:d2f1c9185c5b | 43 | |
tecnosys | 5:d2f1c9185c5b | 44 | //memset((void*)fb, 0x0, lcdCfg.width*lcdCfg.height*2 *3); |
tecnosys | 5:d2f1c9185c5b | 45 | |
tecnosys | 5:d2f1c9185c5b | 46 | SphereDemo sphereDemo(fb, disp->width(), disp->height());//(uint8_t *)frameBuf1 |
tecnosys | 5:d2f1c9185c5b | 47 | while (1) { |
tecnosys | 5:d2f1c9185c5b | 48 | sphereDemo.run(750, 50); |
tecnosys | 5:d2f1c9185c5b | 49 | //.RESET_FLAG; |
tecnosys | 5:d2f1c9185c5b | 50 | } |
tecnosys | 5:d2f1c9185c5b | 51 | |
embeddedartists | 0:8ef5f57e33dc | 52 | } while(false); |
embeddedartists | 0:8ef5f57e33dc | 53 | |
embeddedartists | 0:8ef5f57e33dc | 54 | if (err != DMBoard::Ok) { |
embeddedartists | 0:8ef5f57e33dc | 55 | log->printf("\nTERMINATING\n"); |
embeddedartists | 0:8ef5f57e33dc | 56 | wait_ms(2000); // allow RtosLog to flush messages |
embeddedartists | 0:8ef5f57e33dc | 57 | mbed_die(); |
embeddedartists | 0:8ef5f57e33dc | 58 | } |
embeddedartists | 0:8ef5f57e33dc | 59 | |
embeddedartists | 0:8ef5f57e33dc | 60 | while(true) { |
embeddedartists | 0:8ef5f57e33dc | 61 | } |
embeddedartists | 0:8ef5f57e33dc | 62 | } |