summaryrefslogtreecommitdiff
path: root/flash.c
diff options
context:
space:
mode:
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 ...");