Added Dataflash operational checks and aborts to all projects using the Dataflash...
[pub/USBasp.git] / Demos / Device / LowLevel / MassStorage / MassStorage.c
index e58ac74..947636c 100644 (file)
@@ -80,6 +80,13 @@ void SetupHardware(void)
        Dataflash_Init();
        USB_Init();
 
+       /* Check if the Dataflash is working, abort if not */
+       if (!(DataflashManager_CheckDataflashOperation()))
+       {
+               LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+               for(;;);
+       }
+
        /* Clear Dataflash sector protections, if enabled */
        DataflashManager_ResetDataflashProtections();
 }