  
  	return res;
  }
-@@ -45,27 +49,32 @@
+@@ -45,27 +49,34 @@
  /*-----------------------------------------------------------------------*/
  
  DRESULT disk_writep (

Binary files petitfs_root/.DS_Store and petitfs_root_mod/.DS_Store differ
diff -ENwbur petitfs_root/src/diskio.c petitfs_root_mod/src/diskio.c
--- petitfs_root/src/diskio.c	2014-06-10 00:24:26.000000000 +0200
+++ petitfs_root_mod/src/diskio.c	2014-11-06 22:05:13.000000000 +0100
@@ -2,6 +2,9 @@
 /* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2014      */
 /*-----------------------------------------------------------------------*/

 
+	static uint32_t sector;
+
+	static uint8_t block_data[SD_BLOCKSIZE];
+	static int16_t data_written = 0;
 
 	if (!buff) {
 		if (sc) {
