#include "FS.h" #include "SPIFFS.h" //#include #define TRUE 1 #define FALSE 0 //SPIFlash flash(SS1, &SPI1); //Use this constructor if using an SPI bus other than the default SPI. Only works with chips with more than one hardware SPI bus //SPIFlash flash(4,&SPI); #define SPI2_NSS_PIN 28 #include "SPI.h" #include //#include // Use hardware SPI (on Uno, #13, #12, #11) and the above for Enable,CS/DC,Reset void setup() { unsigned long micross = micros(); // transparentImage(Startbyte Pic,Startbyte background,x,y, width, height, Transparency Color); transparentImage(0,198900,0,0, 100, 100, 0xFFFFFF); Serial.println((micros() - micross) / 1000); } int z = 0; int p = 0; void loop() { } void transparentImage(uint32_t startpic, uint32_t startbackground, int x, int y, int width, int height, uint32_t tcolor) { //read background clipping File f = SPIFFS.open( "/pics.bin", "r"); char *buf = (char*)malloc(width * height * 3); char *temp = (char*)malloc(width * 3); // Serial.println("1"); unsigned long offset = 0; for (int i; i < height; i++) { unsigned long offset = startbackground + (x * width - (width - y) + (i * width * 3)); f.seek(offset, SeekSet); f.readBytes((char*)temp, width * 3) ; memcpy( buf + (i * width), temp, (width * 3) ); } // Inhalt der Textdatei wird gelesen... f.close(); File fc = SPIFFS.open( "/pics.bin", "r"); for (int i; i < height; i++) { unsigned long offset = startpic+i*width; fc.seek(offset, SeekSet); fc.readBytes((char*)temp, width * 3) ; for(int h=0;h