Style police: white space only change; consistent indentation, wrap

long lines to < 80 columns.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@447 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean 2005-02-10 16:34:55 +00:00
parent aa3b5ee436
commit 3ad88ee11c
1 changed files with 199 additions and 184 deletions

View File

@ -245,22 +245,25 @@ typedef void (*FP_UpdateProgress)(int percent, double etime, char *hdr);
static FP_UpdateProgress update_progress; static FP_UpdateProgress update_progress;
/* Report the progress of a read or write operation from/to the device. /*
* Report the progress of a read or write operation from/to the
The first call of report_progress() should look like this (for a write op): * device.
*
report_progress (0, 1, "Writing"); * The first call of report_progress() should look like this (for a write op):
*
Then hdr should be passed NULL on subsequent calls while the operation is * report_progress (0, 1, "Writing");
progressing. Once the operation is complete, a final call should be made as *
such to ensure proper termination of the progress report: * Then hdr should be passed NULL on subsequent calls while the
* operation is progressing. Once the operation is complete, a final
report_progress (1, 1, NULL); * call should be made as such to ensure proper termination of the
* progress report:
It would be nice if we could reduce the usage to one and only one call for *
each of start, during and end cases. As things stand now, that is not * report_progress (1, 1, NULL);
possible and makes maintenance a bit more work. */ *
* It would be nice if we could reduce the usage to one and only one
* call for each of start, during and end cases. As things stand now,
* that is not possible and makes maintenance a bit more work.
*/
void report_progress (int completed, int total, char *hdr) void report_progress (int completed, int total, char *hdr)
{ {
static int last = 0; static int last = 0;
@ -1215,12 +1218,16 @@ int main(int argc, char * argv [])
unsigned char safemode_hfuse = 0xff; unsigned char safemode_hfuse = 0xff;
unsigned char safemode_efuse = 0xff; unsigned char safemode_efuse = 0xff;
if (safemode == 1) { if (safemode == 1) {
/* If safemode is enabled, go ahead and read the current low, high, and extended fuse bytes as needed */ /* If safemode is enabled, go ahead and read the current low, high,
and extended fuse bytes as needed */
fprintf(stderr, "\n"); fprintf(stderr, "\n");
if (safemode_readfuses (&safemode_lfuse, &safemode_hfuse, &safemode_efuse, pgm, p, verbose) != 0) { if (safemode_readfuses(&safemode_lfuse, &safemode_hfuse,
fprintf(stderr, "%s: safemode: To protect your AVR the programming will be aborted\n", progname); &safemode_efuse, pgm, p, verbose) != 0) {
fprintf(stderr, "%s: safemode: To protect your AVR the programming "
"will be aborted\n",
progname);
exitrc = 1; exitrc = 1;
goto main_exit; goto main_exit;
} }
@ -1352,10 +1359,11 @@ int main(int argc, char * argv [])
} }
} }
/* Right before we exit programming mode, which will make the fuse bits active, /* Right before we exit programming mode, which will make the fuse
check to make sure they are still correct */ bits active, check to make sure they are still correct */
if (safemode == 1){ if (safemode == 1){
/* If safemode is enabled, go ahead and read the current low, high, and extended fuse bytes as needed */ /* If safemode is enabled, go ahead and read the current low,
* high, and extended fuse bytes as needed */
unsigned char safemodeafter_lfuse = 0xff; unsigned char safemodeafter_lfuse = 0xff;
unsigned char safemodeafter_hfuse = 0xff; unsigned char safemodeafter_hfuse = 0xff;
unsigned char safemodeafter_efuse = 0xff; unsigned char safemodeafter_efuse = 0xff;
@ -1367,10 +1375,14 @@ int main(int argc, char * argv [])
safemode_memfuses(0, &safemode_lfuse, &safemode_hfuse, &safemode_efuse); safemode_memfuses(0, &safemode_lfuse, &safemode_hfuse, &safemode_efuse);
/* Try reading back fuses, make sure they are reliable to read back */ /* Try reading back fuses, make sure they are reliable to read back */
if (safemode_readfuses (&safemodeafter_lfuse, &safemodeafter_hfuse, &safemodeafter_efuse, pgm, p, verbose) != 0) { if (safemode_readfuses(&safemodeafter_lfuse, &safemodeafter_hfuse,
&safemodeafter_efuse, pgm, p, verbose) != 0) {
/* Uh-oh.. try once more to read back fuses */ /* Uh-oh.. try once more to read back fuses */
if (safemode_readfuses (&safemodeafter_lfuse, &safemodeafter_hfuse, &safemodeafter_efuse, pgm, p, verbose) != 0) { if (safemode_readfuses(&safemodeafter_lfuse, &safemodeafter_hfuse,
fprintf(stderr, "%s: safemode: Sorry, reading back fuses was unreliable. I have given up and exited programming mode\n", &safemodeafter_efuse, pgm, p, verbose) != 0) {
fprintf(stderr,
"%s: safemode: Sorry, reading back fuses was unreliable. "
"I have given up and exited programming mode\n",
progname); progname);
exitrc = 1; exitrc = 1;
goto main_exit; goto main_exit;
@ -1379,11 +1391,12 @@ int main(int argc, char * argv [])
/* Now check what fuses are against what they should be */ /* Now check what fuses are against what they should be */
if (safemodeafter_lfuse != safemode_lfuse) { if (safemodeafter_lfuse != safemode_lfuse) {
fprintf(stderr, "%s: safemode: lfuse changed! Read as %x, was %x\n", progname, fprintf(stderr, "%s: safemode: lfuse changed! Read as %x, was %x\n",
safemodeafter_lfuse, safemode_lfuse); progname, safemodeafter_lfuse, safemode_lfuse);
/* Enough chit-chat, time to program some fuses and check them */ /* Enough chit-chat, time to program some fuses and check them */
if (safemode_writefuse (safemode_lfuse, "lfuse", pgm, p, 10, verbose) == 0) { if (safemode_writefuse (safemode_lfuse, "lfuse", pgm, p,
10, verbose) == 0) {
fprintf(stderr, "%s: safemode: and is now rescued\n", progname); fprintf(stderr, "%s: safemode: and is now rescued\n", progname);
} }
else { else {
@ -1394,11 +1407,12 @@ int main(int argc, char * argv [])
/* Now check what fuses are against what they should be */ /* Now check what fuses are against what they should be */
if (safemodeafter_hfuse != safemode_hfuse) { if (safemodeafter_hfuse != safemode_hfuse) {
fprintf(stderr, "%s: safemode: hfuse changed! Read as %x, was %x\n", progname, fprintf(stderr, "%s: safemode: hfuse changed! Read as %x, was %x\n",
safemodeafter_hfuse, safemode_hfuse); progname, safemodeafter_hfuse, safemode_hfuse);
/* Enough chit-chat, time to program some fuses and check them */ /* Enough chit-chat, time to program some fuses and check them */
if (safemode_writefuse (safemode_hfuse, "hfuse", pgm, p, 10, verbose) == 0) { if (safemode_writefuse(safemode_hfuse, "hfuse", pgm, p,
10, verbose) == 0) {
fprintf(stderr, "%s: safemode: and is now rescued\n", progname); fprintf(stderr, "%s: safemode: and is now rescued\n", progname);
} }
else { else {
@ -1409,11 +1423,12 @@ int main(int argc, char * argv [])
/* Now check what fuses are against what they should be */ /* Now check what fuses are against what they should be */
if (safemodeafter_efuse != safemode_efuse) { if (safemodeafter_efuse != safemode_efuse) {
fprintf(stderr, "%s: safemode: efuse changed! Read as %x, was %x\n", progname, fprintf(stderr, "%s: safemode: efuse changed! Read as %x, was %x\n",
safemodeafter_efuse, safemode_efuse); progname, safemodeafter_efuse, safemode_efuse);
/* Enough chit-chat, time to program some fuses and check them */ /* Enough chit-chat, time to program some fuses and check them */
if (safemode_writefuse (safemode_efuse, "efuse", pgm, p, 10, verbose) == 0) { if (safemode_writefuse (safemode_efuse, "efuse", pgm, p,
10, verbose) == 0) {
fprintf(stderr, "%s: safemode: and is now rescued\n", progname); fprintf(stderr, "%s: safemode: and is now rescued\n", progname);
} }
else { else {