Doug Anson / mbedConnectorInterfaceWithDM

Fork of mbedConnectorInterfaceV3 by Doug Anson

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Tue Sep 26 16:01:31 2017 +0000
Parent:
126:f37e34daa100
Commit message:
minor re-ordering of FCC init

Changed in this revision

source/ConnectorEndpoint.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/ConnectorEndpoint.cpp	Thu Jul 13 20:43:26 2017 +0000
+++ b/source/ConnectorEndpoint.cpp	Tue Sep 26 16:01:31 2017 +0000
@@ -237,23 +237,24 @@
 	// initialize mbed-trace
 	mbed_trace_init();
 	
+	// now initialize the FCC interface
+	fcc_status_e status = fcc_init();
+    if(status != FCC_STATUS_SUCCESS) {
+        this->logger()->log("initializeStorage: ERROR: mfcc_init failed with status=%d...", status);
+        return false;
+    }
+	#ifdef MBED_RESET_STORAGE
 	// Resets storage to an empty state.
 	// Use this function when you want to clear SD card from all the factory-tool generated data and user data.
 	// After this operation device must be injected again by using factory tool or developer certificate.
-#ifdef MBED_RESET_STORAGE
     this->logger()->log("initializeStorage: Resetting storage to an empty state...");
     fcc_status_e delete_status = fcc_storage_delete();
     if (delete_status != FCC_STATUS_SUCCESS) {
         this->logger()->log("initializeStorage: Failed to reset storage to an empty state. status=%d (OK)...", delete_status);
     }
-#endif
-    fcc_status_e status = fcc_init();
-    if(status != FCC_STATUS_SUCCESS) {
-        this->logger()->log("initializeStorage: ERROR: mfcc_init failed with status=%d...", status);
-        return false;
-    }
+	#endif
 #else
-    // not enabled
+    // storage initialization not enabled
     this->logger()->log("initializeStorage: storage initialize disabled (OK)...");
 #endif
     return true;