PokittoLib with changes to lcd refresh etc.

Dependents:   Pokittris

Fork of Pokitto by Pokitto Community Team

This is a fork by user @Spinal, and is used in Pokittris for testing. Do not import this to your own program.

Revision:
7:fee7bc74477f
Parent:
3:689c3cbbef13
--- a/POKITTO_CORE/PokittoCore.cpp	Sat Oct 07 21:34:27 2017 +0000
+++ b/POKITTO_CORE/PokittoCore.cpp	Sun Oct 08 18:51:34 2017 +0000
@@ -48,6 +48,9 @@
 char selectedfile[25];
 
 //#define F 
+#ifdef __ARMCC_VERSION
+typedef void (*func_t)(void);
+#endif 
 
 #ifndef POK_SIM
 /** start the user application
@@ -104,11 +107,17 @@
 LPC_GPIO_PORT->PIN[2] = 0;
 
 SCB->VTOR = app_link_location;//APPL_ADDRESS; /* Change vector table address */
-/*asm(" mov r0, %[address]"::[address] "r" (app_link_location));
+#ifndef __ARMCC_VERSION
+asm(" mov r0, %[address]"::[address] "r" (app_link_location));
 asm(" ldr r1, [r0,#0]"); // get the stack pointer value from the program's reset vector
 asm(" mov sp, r1");      // copy the value to the stack pointer
 asm(" ldr r0, [r0,#4]"); // get the program counter value from the program's reset vector
-asm(" blx r0");          // jump to the' start address*/
+asm(" blx r0");          // jump to the' start address
+#else
+uint32_t *app_loc = (uint32_t*)app_link_location;
+__set_MSP (app_loc[0]);
+((func_t)(app_loc[1]))();
+#endif
 }
 #endif
 
@@ -208,9 +217,10 @@
     display.println("LOADER IS NOT AVAILABLE ON THE SIMULATOR. PRESS A TO RETURN.");
     #else
     uint32_t* bootinfo;
-    bootinfo = (uint32_t*)0x3FFF4;
+    bootinfo = (uint32_t*)0x3FE04;
     if (*bootinfo != 0xB007AB1E) display.println("NO LOADER CONNECTED!");
     else start_application(*(bootinfo+2)); //never returns
+    //display.println((unsigned int)(*(bootinfo+2)),16); 
     #endif // POK_SIM
     while (!buttons.aBtn()) {
         buttons.pollButtons();