YatlCPM/abstraction_arduino_esp.h
// Xtase - I did modify this routine to speed system up
// ** SLOW POINT **
I did modify this routine to speed system up
SLOW POINT
I did modify this routine to speed system up SLOW POINT
uint8 _sys_readseq(uint8 *filename, long fpos) {
	uint8 result = 0xff;
	File f;
	uint8 bytesread;
	uint8 dmabuf[128];
	uint8 i;
	driveLED(true);
	f = SD.open( getFileEntryPath((char*)filename), O_READ);
	if ( f ) {
		if ( fpos > f.size() ) {
			uint8 _result = _sys_extendfile((char*)filename, fpos);
			f = SD.open( getFileEntryPath((char*)filename), O_READ);
			sprintf(cachedFileName, "%s", "XXX.XX"); 
		}
	} else {
		Serial.println( "There was a mistake ..." );
		Serial.println(fpos);
		Serial.println((char*)filename);
		f = SD.open( getFileEntryPath((char*)filename), O_READ);
		sprintf(cachedFileName, "%s", "XXX.XX"); 
	}
	if (f) {
		if (f.seek(fpos)) {
			memset(dmabuf, 0x1a, 128);
			bytesread = f.read(&dmabuf[0], 128);
			if (bytesread) {
				memcpy( &RAM[dmaAddr], &dmabuf[0], 128 );
			}
			result = bytesread ? 0x00 : 0x01;
		} else {
			Serial.println("could not seek");
			Serial.println(fpos);
			Serial.println((char*)filename);
			result = 0x01;
		}
		f.close();
	} else {
		Serial.println("file was false");
		result = 0x10;
	}
	driveLED(false);
	return(result);
}
uint8 _sys_readseq ( uint8 * filename , long fpos ) { uint8 result = 0xff ; File f ; uint8 bytesread ; uint8 dmabuf [ 128 ] ; uint8 i ; driveLED ( true ) ; f = SD . open ( getFileEntryPath ( ( char * ) filename ) , O_READ ) ; if ( f ) { if ( fpos > f . size ( ) ) { uint8 _result = _sys_extendfile ( ( char * ) filename , fpos ) ; f = SD . open ( getFileEntryPath ( ( char * ) filename ) , O_READ ) ; sprintf ( cachedFileName , " " , " " ) ; } } else { Serial . println ( " " ) ; Serial . println ( fpos ) ; Serial . println ( ( char * ) filename ) ; f = SD . open ( getFileEntryPath ( ( char * ) filename ) , O_READ ) ; sprintf ( cachedFileName , " " , " " ) ; } if ( f ) { if ( f . seek ( fpos ) ) { memset ( dmabuf , 0x1a , 128 ) ; bytesread = f . read ( & dmabuf [ 0 ] , 128 ) ; if ( bytesread ) { memcpy ( & RAM [ dmaAddr ] , & dmabuf [ 0 ] , 128 ) ; } result = bytesread ? 0x00 : 0x01 ; } else { Serial . println ( " " ) ; Serial . println ( fpos ) ; Serial . println ( ( char * ) filename ) ; result = 0x01 ; } f . close ( ) ; } else { Serial . println ( " " ) ; result = 0x10 ; } driveLED ( false ) ; return ( result ) ; }
Xtase - I did modify this routine to speed system up
 SLOW POINT
Xtase - I did modify this routine to speed system up SLOW POINT
// startCounter(); // 82ms // if (_sys_extendfile((char*)filename, fpos)) // 	f = SD.open( getFileEntryPath((char*)filename), O_READ); // 42ms // if ( strcmp((const char*)filename, (const char*)cachedFileName) == 0 && //      fpos >= cachedFpos // don't know rewind .... //    ) { // 	f = cachedFile; // } else { // 	f = SD.open( getFileEntryPath((char*)filename), O_READ); // 	cachedFile = f; // 	sprintf(cachedFileName, "%s", (char*)filename); // } // cachedFpos = fpos; // Serial.println( "I did need to extendFile !" ); // Serial.println(fpos); // Serial.println((char*)filename); // re-open file // erase cache // re-open file // erase cache // for (i = 0; i < 128; ++i) // 	dmabuf[i] = 0x1a; // for (i = 0; i < 128; ++i) // 	_RamWrite(dmaAddr + i, dmabuf[i]); // stopCounter("redS");