summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-03-15 14:26:53 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-03-15 14:26:53 +0000
commit7ed10a6da8346e701a7fdb3700193cf05f5f1641 (patch)
treea0a367f69b62dfd79c7a96a24edc37ddcd05f1ce
parentad4aa24141c73075ab6c24a34bb3709239fc4204 (diff)
improve error messaging
-rw-r--r--src/sp12.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/sp12.c b/src/sp12.c
index c0c9139..ef4fd97 100644
--- a/src/sp12.c
+++ b/src/sp12.c
@@ -664,10 +664,9 @@ void processCommand(void) {
rFlag = writeFuses(WRITE_LOCK_HM, WRITE_LOCK_LM, lockBits, \
W_LOCKLSB, W_LOCKLEN);
if (rFlag == 9) {
- fprintf(stderr, "For the %s: Write_lock not defined in _sp12dev.\n",
- device.name);
+ fprintf(stderr, "For the %s: Write_lock not defined in _sp12dev.\n", device.name);
} else if (rFlag == 2) {
- fprintf(stderr, "For the %s: Wrong number of lock bits.\n", device.name);
+ fprintf(stderr, "For the %s: Wrong number of lock bits, expect %d.\n", device.name, W_LOCKLEN);
} else {
for (idx = 0; idx < R_LOCKLEN - W_LOCKLEN; idx++)
printf(" ");
@@ -680,10 +679,9 @@ void processCommand(void) {
rFlag = writeFuses(WRITE_FUSES_HM, WRITE_FUSES_LM, fusesBits, \
W_FUSESLSB, W_FUSESLEN);
if (rFlag == 9) {
- fprintf(stderr, "For the %s: Write_fuses not defined in _sp12dev.\n",
- device.name);
+ fprintf(stderr, "For the %s: Write_fuses not defined in _sp12dev.\n", device.name);
} else if (rFlag == 2) {
- fprintf(stderr, "For the %s; Wrong number of fuse bits.\n", device.name);
+ fprintf(stderr, "For the %s; Wrong number of fuse bits, expect %d.\n", device.name, W_FUSESLEN);
} else {
for (idx = 0; idx < (R_FUSESLEN - W_FUSESLEN) - W_FUSESLSB; idx++)
printf(" ");
@@ -696,11 +694,9 @@ void processCommand(void) {
rFlag = writeFuses(WRITE_HIGH_FUSES_HM, WRITE_HIGH_FUSES_LM, fusesBits, \
WH_FUSESLSB, WH_FUSESLEN);
if (rFlag == 9) {
- fprintf(stderr, "For the %s: Write_high_fuses not defined in _sp12dev.\n",
- device.name);
+ fprintf(stderr, "For the %s: Write_high_fuses not defined in _sp12dev.\n", device.name);
} else if (rFlag == 2) {
- fprintf(stderr, "For the %s; Wrong number of high fuse bits.\n",
- device.name);
+ fprintf(stderr, "For the %s; Wrong number of high fuse bits, expect %d.\n", device.name, WH_FUSESLEN);
} else {
for (idx = 0; idx < (RH_FUSESLEN - WH_FUSESLEN) - WH_FUSESLSB; idx++)
printf(" ");
@@ -713,11 +709,9 @@ void processCommand(void) {
rFlag = writeFuses(WRITE_EXTD_FUSES_HM, WRITE_EXTD_FUSES_LM, fusesBits, \
WX_FUSESLSB, WX_FUSESLEN);
if (rFlag == 9) {
- fprintf(stderr, "For the %s: Write_extd_fuses not defined in _sp12dev.\n",
- device.name);
+ fprintf(stderr, "For the %s: Write_extd_fuses not defined in _sp12dev.\n", device.name);
} else if (rFlag == 2) {
- fprintf(stderr, "For the %s; Wrong number of high fuse bits.\n",
- device.name);
+ fprintf(stderr, "For the %s; Wrong number of extended fuse bits, expect %d.\n", device.name, WX_FUSESLEN);
} else {
for (idx = 0; idx < (RX_FUSESLEN - WX_FUSESLEN) - WX_FUSESLSB; idx++)
printf(" ");