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 Embedded Artists

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "DMBoard.h"
00003 //#include "lpc_swim.h"
00004 //#include "lpc_swim_font.h"
00005 #include "SphereDemo.h"
00006 
00007 bool abortTest;
00008 
00009 int main()
00010 {
00011   
00012   DMBoard::BoardError err;
00013   DMBoard* board = &DMBoard::instance();
00014   RtosLog* log = board->logger();
00015   Display* disp = board->display();
00016   abortTest=false;
00017   
00018   do {
00019     err = board->init();
00020     if (err != DMBoard::Ok) {
00021       log->printf("Failed to initialize the board, got error %d\r\n", err);
00022       break;
00023     }
00024     
00025     //log->printf("\n\nHello World!\n\n");
00026     
00027    // SWIM_WINDOW_T win;
00028     void* fb = disp->allocateFramebuffer();
00029     if (fb == NULL) {
00030       log->printf("Failed to allocate memory for a frame buffer\r\n");
00031       err = DMBoard::MemoryError;
00032       break;
00033     }
00034     
00035  
00036     // Start display in default mode (16-bit)
00037     Display::DisplayError disperr = disp->powerUp(fb);
00038     if (disperr != Display::DisplayError_Ok) {
00039       log->printf("Failed to initialize the display, got error %d\r\n", disperr);
00040       break;
00041     }
00042     
00043     
00044 //memset((void*)fb, 0x0, lcdCfg.width*lcdCfg.height*2 *3);
00045 
00046         SphereDemo sphereDemo(fb, disp->width(), disp->height());//(uint8_t *)frameBuf1
00047         while (1) {
00048             sphereDemo.run(750, 50);
00049             //.RESET_FLAG;
00050         }
00051     
00052   } while(false);
00053 
00054   if (err != DMBoard::Ok) {
00055     log->printf("\nTERMINATING\n");
00056     wait_ms(2000); // allow RtosLog to flush messages
00057     mbed_die();
00058   }  
00059 
00060   while(true) {
00061   }   
00062 }