From 3ea356a72054b540e1c529fee5f55b10324254a4 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 9 Mar 2012 22:02:29 +0000 Subject: Added Dataflash operational checks and aborts to all projects using the Dataflash to ensure it is working correctly before use. --- Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c | 7 +++++++ Projects/TempDataLogger/TempDataLogger.c | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'Projects') diff --git a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c index cc79a8321..86318e9cb 100644 --- a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c +++ b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.c @@ -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 diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c index 258bfc386..83590b311 100644 --- a/Projects/TempDataLogger/TempDataLogger.c +++ b/Projects/TempDataLogger/TempDataLogger.c @@ -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(); } -- cgit v1.2.3