Added Dataflash operational checks and aborts to all projects using the Dataflash...
[pub/USBasp.git] / Demos / Device / ClassDriver / MassStorage / MassStorage.c
index 55afed1..6a720f9 100644 (file)
@@ -92,6 +92,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();
 }