A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Revision:
26:a65fbb4bde5c
Parent:
24:9a677afc86f1
Child:
27:0499c29688cc
--- a/Bios/BiosLoader.cpp	Tue Jan 20 09:11:28 2015 +0100
+++ b/Bios/BiosLoader.cpp	Thu Jan 22 16:04:54 2015 +0100
@@ -25,7 +25,7 @@
   #ifdef __cplusplus
     extern "C" {
   #endif
-      void bios_debug_aid(bios_header_t* header, const char** pMsg);
+      void bios_debug_aid(bios_header_t* header, const char** pMsg, uint32_t* paramSize);
   #ifdef __cplusplus
     }
   #endif
@@ -48,7 +48,14 @@
   #define MAX(__a, __b) (((__a)>(__b))?(__a):(__b))
 #endif
 
-
+/*
+ * The BIOS is API compatible as long as the Major component of the
+ * version is the same.
+ */
+#define SUPPORTED_BIOS_VER   0x000000
+#define SUPPORTED_BIOS_MASK  0xff0000  // only look at the Major component
+#define SUPPORTED_VERSION(__ver) (((__ver)&SUPPORTED_BIOS_MASK) == SUPPORTED_BIOS_VER)
+    
 /******************************************************************************
  * Local variables
  *****************************************************************************/
@@ -112,7 +119,7 @@
       break;
     }
     
-    if (fh.version != BIOS_VER) {
+    if (!SUPPORTED_VERSION(fh.version)) {
       err = DMBoard::BiosVersionError;
       break;
     }
@@ -214,7 +221,16 @@
 #if defined(DM_BOARD_BIOS_DEVELOPMENT)
       // This requires that the project contains the source code for the BIOS
       const char* msg;
-      bios_debug_aid(&_bios, &msg);
+      uint32_t tmp = 0;
+      bios_debug_aid(&_bios, &msg, &tmp);
+      if (tmp > file_header->paramSize) {
+        free(_biosData);
+        _biosData = malloc(tmp);
+        if (_biosData == NULL) {
+          err = DMBoard::MemoryError;
+          break;
+        }
+      }
       DMBoard::instance().logger()->printf("BIOS info: %s\n", msg);
 #endif