diff options
author | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:00:50 -0500 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1999-12-31 19:00:50 -0500 |
commit | 963139a3517c094181086e901c203fbce38842f6 (patch) | |
tree | d56811e4a45ff063431582b3ae0f1838469e5bd8 /flash.c | |
parent | 16d6dea985b85ff596e98d4dc7f15f341ad6966b (diff) |
Some flags must not be reset by Main_Rst. Put in separate struct.
Diffstat (limited to 'flash.c')
-rw-r--r-- | flash.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -272,10 +272,10 @@ static int readUserBlock(FlashStruct *mem) // hopefully we can use the backup.. if (persistence_unfreeze(BACKUPFILE, mem, sizeof(*mem), 0)) { // if the backup was good overwrite the main file - if (!globals.Flags.shutdown_started) { - globals.Flags.flash_write_in_progress = TRUE; + if (!globals.Sys.shutdown_started) { + globals.Sys.flash_write_in_progress = TRUE; persistence_copyfile(BACKUPFILE, MAINFILE); - globals.Flags.flash_write_in_progress = FALSE; + globals.Sys.flash_write_in_progress = FALSE; } return sizeof(*mem); } @@ -301,14 +301,14 @@ void writeUserBlock(FlashStruct *mem, int addr, int numbytes) if (!globals.Flags.flash_writes_suspended) { // backup the main copy of the file - if (!globals.Flags.shutdown_started) { + if (!globals.Sys.shutdown_started) { - globals.Flags.flash_write_in_progress = TRUE; + globals.Sys.flash_write_in_progress = TRUE; bool backup_ok = persistence_copyfile(MAINFILE, BACKUPFILE); - globals.Flags.flash_write_in_progress = FALSE; + globals.Sys.flash_write_in_progress = FALSE; - if (backup_ok && !globals.Flags.shutdown_started) { - globals.Flags.flash_write_in_progress = TRUE; + if (backup_ok && !globals.Sys.shutdown_started) { + globals.Sys.flash_write_in_progress = TRUE; if (!persistence_freeze(MAINFILE, mem, addr, numbytes, sizeof(*mem), 0)) { if (errno != PERSIST_ERR_COULDNTWRITE) { @@ -317,7 +317,7 @@ void writeUserBlock(FlashStruct *mem, int addr, int numbytes) printf("Error while writing data to disk. **File is potentially corrupt!**\n"); } } - globals.Flags.flash_write_in_progress = FALSE; + globals.Sys.flash_write_in_progress = FALSE; } else { printf("Could not backup current file. **Write did not happen!!!**\n"); } |