*** empty log message ***
[yaffs/.git] / yaffsdev.c
index 64368f449852501b44ca423e0312e1fb50eb367e..e38a98330a5f04b2f4139ea86a3a431dd71e8be1 100644 (file)
  */
  
 #include "yaffsinterface.h"
+#if YAFFS_FILEEM       
+#include "yaffs_fileem.h"
+#else
 #include "yaffs_nandemul.h" 
+#endif
+
 #include "yaffs_guts.h"
 #include <stdlib.h>
 
@@ -287,12 +292,23 @@ int main(int argc,char *argv[])
        device.nBlocks = (2 * 1024 * 1024) / (YAFFS_CHUNKS_PER_BLOCK * YAFFS_BYTES_PER_CHUNK);
        device.startBlock = 1;  // Don't use block 0
        device.endBlock = device.nBlocks - 1;
-       
+
+#if YAFFS_FILEEM       
+       device.writeChunkToNAND = yaffs_FEWriteChunkToNAND;
+       device.readChunkFromNAND = yaffs_FEReadChunkFromNAND;
+       device.eraseBlockInNAND = yaffs_FEEraseBlockInNAND;
+       device.initialiseNAND = yaffs_FEInitialiseNAND;
+
+       printf("Testing on file emulation\n");
+#else
        device.writeChunkToNAND = nandemul_WriteChunkToNAND;
        device.readChunkFromNAND = nandemul_ReadChunkFromNAND;
        device.eraseBlockInNAND = nandemul_EraseBlockInNAND;
        device.initialiseNAND = nandemul_InitialiseNAND;
        
+       printf("Testing on RAM emulation\n");
+#endif
+
        yaffs_GutsInitialise(&device);
        
        // yaffs_GutsTest();