liquidware / antipasto_arduino

A Liquidware Arduino Distribution
antipastohw.blogspot.com
Other
29 stars 11 forks source link

Upload to Touchshield slide of 91 images fails #14

Open crone opened 14 years ago

crone commented 14 years ago

I am having major problems with uploading 91 bitmaps to my TouchShield Slide. The first 34 images are no problem. They are uploaded correctly. But then the screen background gets grey (in stead of black). It looks like the images are still uploaded, but I cannot use them afterwards. The screen gets scrambled although I see some of the colors of the bitmaps that I uploaded.

My 91 images are around 800kb in total. This looks like a buffer overflow of some sort. I tried to hack the FlashFileSystem.ccp file but I had no luck at all. I have this issue both on XP and OSX.

I thought that the TouchShield Slide is able to store 2mb of images? My upload breaks half-way; after 300kb of data. The bmp files that I try to upload can be found in this zipfile (in the images_bitmaps folder): http://openmoco.org/downloads/openmoco_min.zip

I am running the following on the Slide during image upload: PImage battlePic; //Create an image

void setup() { background(0); //set the entire screen to black

open(FlashTransfer); //Waits for the IDE to send files to TouchShield’s flash storage. battlePic = loadImage(“battle.bmp”); //read the uploaded image file from memory

image(battlePic,0,0); //paint image at pixel location (0,0) }

void loop() { // Do nothing! }

I am running the following on the Arduino during upload void setup(){ }

void loop(){ }

I anyone able to upload the images mentioned in the zipfile? Or am I missing something here?

joaobarros commented 14 years ago

on bmp.h you have:

define kLookupTableMaxEntries (kLookupTableSize / kSizeOfFlashFileEntry)

define kLookupTableSize DATAFLASH_PAGESIZE

define DATAFLASH_PAGESIZE 528

define kSizeOfFlashFileEntry 16

which turns out to be 528 / 16 = 33

From what I can see the code only uses 1 flash page so there's the limit.