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
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
Diff: POKITTO_CORE/PokittoCookie.cpp
- Revision:
- 58:5f58a2846a20
- Parent:
- 51:113b1d84c34f
- Child:
- 66:6281a40d73e6
diff -r 63853054a4d9 -r 5f58a2846a20 POKITTO_CORE/PokittoCookie.cpp --- a/POKITTO_CORE/PokittoCookie.cpp Tue Oct 02 20:38:50 2018 +0000 +++ b/POKITTO_CORE/PokittoCookie.cpp Sun Oct 07 10:06:28 2018 +0000 @@ -124,6 +124,7 @@ _block=0; _block=findMyNextBlock(); for (int i=0; i<_datasize; i++) writeQueue(*p++); + return true; } bool Cookie::loadCookie() { @@ -133,6 +134,7 @@ _block=0; _block=findMyNextBlock(); for (int i=0; i<_datasize; i++) *p++ = readQueue(); + return true; } void Cookie::deleteCookie() { @@ -245,7 +247,7 @@ #ifndef POK_SIM return eeprom_read_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+n)); #endif - return 0x80; + //return 0x80; } void Cookie::readBlock(int n, char* data) { @@ -356,6 +358,7 @@ int Cookie::findMyNextBlock() { if (!_status) return SBINVALIDBLOCK; for (int i=_block; i<SBMAXBLOCKS;i++) if (isMyBlock(i)) return i; + return SBINVALIDBLOCK; }