summaryrefslogtreecommitdiff
path: root/flash.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-24 13:31:13 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-24 13:31:13 -0400
commitb72469c072514317602d1345b3d19e2375a90ab5 (patch)
tree120ab9fde332c9d645500d8977471d066d9228ff /flash.c
parent6289747b35eef38cca5d5d3076b4ec6d33f9053f (diff)
added diag:eprom:reset
Diffstat (limited to 'flash.c')
-rw-r--r--flash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/flash.c b/flash.c
index 48e180e..a403f67 100644
--- a/flash.c
+++ b/flash.c
@@ -12,6 +12,7 @@
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <mhash.h>
+#include <glib.h>
#define MAINFILE "/root/flash.copy"
#define BACKUPFILE "/root/flash.bup"
@@ -757,13 +758,15 @@ static void initFlashValues(FlashStruct *mem)
}
-void initFlash(FlashStruct *mem, int starting_location)
+void initFlash(FlashStruct *mem, gboolean reset_to_defaults, int starting_location)
{
int read_size = readUserBlock(mem);
if ( (read_size == 0) ||
(mem->fully_programmed == Not_Programmed) ||
- ((starting_location > 0) && (starting_location < sizeof(*mem))) ) {
+ (reset_to_defaults &&
+ (starting_location >= 0) &&
+ (starting_location < sizeof(*mem))) ) {
g_print_debug ("initializing flash memory\n");
LCD_write(0,0,"Initialize Flash Memory ...");