Seiji Ainoguchi / SerialFlash

Dependents:   SerialFlashTest

Fork of SerialFlash by Seiji Ainoguchi

Revision:
0:d0117f54a7ee
Child:
2:6f8ab876b516
diff -r 000000000000 -r d0117f54a7ee SerialFlashDeviceCreator.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SerialFlashDeviceCreator.cpp	Tue Mar 01 15:44:13 2011 +0000
@@ -0,0 +1,17 @@
+#include "ISerialFlashDevice.h"
+#include "SST25Device.h"
+#include "M25PDevice.h"
+#include "SerialFlashDeviceCreator.h"
+
+ISerialFlashDevice* SerialFlashDeviceCreator::Create(ISPI* pSPI)
+{
+    if (M25PDevice::IsSupported(pSPI))
+    {
+        return M25PDevice::Create(pSPI);
+    }
+    if (SST25Device::IsSupported(pSPI))
+    {
+        return SST25Device::Create(pSPI);
+    }
+    return NULL;
+}