Added Dataflash operational checks and aborts to all projects using the Dataflash to ensure it is working correctly before use.

This commit is contained in:
Dean Camera 2012-03-09 22:02:29 +00:00
parent 8de8d7ab5a
commit 3ea356a720
8 changed files with 50 additions and 7 deletions

View file

@ -207,6 +207,13 @@ void SetupHardware(void)
TCCR1B = (1 << WGM12) | (1 << CS12) | (1 << CS10);
TIMSK1 = (1 << OCIE1A);
/* 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();
}