PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Revision:
66:6281a40d73e6
Parent:
52:c04087025cab
--- a/POKITTO_CORE/PokittoDisk.cpp	Sat Mar 23 19:22:35 2019 +0000
+++ b/POKITTO_CORE/PokittoDisk.cpp	Sat Mar 23 20:03:34 2019 +0000
@@ -56,14 +56,16 @@
     return dot + 1;
 }
 
-__attribute__((section(".SD_Code"))) void initSDGPIO() {
+//__attribute__((section(".SD_Code")))
+void initSDGPIO() {
     LPC_GPIO_PORT->DIR[SD_MOSI_PORT] |= (1  << SD_MOSI_PIN );
     LPC_GPIO_PORT->DIR[SD_MISO_PORT] |= (1  << SD_MISO_PIN );
     LPC_GPIO_PORT->DIR[SD_SCK_PORT]  |= (1  << SD_SCK_PIN );
     LPC_GPIO_PORT->DIR[SD_CS_PORT]   |= (1  << SD_CS_PIN );
 }
 
-__attribute__((section(".SD_Code"))) int pokInitSD() {
+//__attribute__((section(".SD_Code")))
+int pokInitSD() {
     initSDGPIO();
     res = PFFS::disk_initialize();
     //res = disk_initialize(0);
@@ -81,12 +83,12 @@
 
 /** PUBLIC FUNCTIONS **/
 
-char* getFirstDirEntry() {
+char* getFirstDirEntry(char* path) {
     res=0;
     if (!diropened) {
             pokInitSD();
     }
-    res = pf_opendir(&dir,"");
+    res = pf_opendir(&dir,path);
     emptyFname();
     res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
     if (res) return 0;
@@ -108,6 +110,10 @@
     return 0;
 }
 
+char* getFirstDirEntry() {
+    return getFirstDirEntry("");
+}
+
 char* getNextDirEntry() {
     if (!diropened) pokInitSD();
     emptyFname();
@@ -162,12 +168,12 @@
     return getNextFile("");
 }
 
-char* getFirstFile(char* ext) {
+char* getFirstFile(char* ext, char* path) {
     res=0;
     if (!diropened) {
             pokInitSD();
     }
-    res = pf_opendir(&dir,"");
+    res = pf_opendir(&dir,path);
     emptyFname();
     res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
     if (res) return 0;
@@ -184,6 +190,10 @@
     return 0;
 }
 
+char* getFirstFile(char* ext) {
+    return getFirstFile(ext, "");
+}
+
 char* getFirstFile() {
     return getFirstFile("");
 }