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:
@@ -155,6 +155,13 @@ void SetupHardware(void)
|
||||
Serial_CreateStream(NULL);
|
||||
|
||||
#if defined(USB_CAN_BE_DEVICE)
|
||||
/* 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();
|
||||
#endif
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user