summaryrefslogtreecommitdiffstats
path: root/commandline
diff options
context:
space:
mode:
authorBluebie <a@creativepony.com>2013-12-18 09:00:38 +1100
committerBluebie <a@creativepony.com>2013-12-18 09:00:38 +1100
commit0de222efe437027c73cd086eaf29ed9921f1b221 (patch)
treeead8e490631f9f2c5cc88f62c5d703e2213f2f0b /commandline
parent46ee37b4ce55c4e6e6118951455b14f064e70b2a (diff)
downloadmicronucleus-0de222efe437027c73cd086eaf29ed9921f1b221.tar.gz
micronucleus-0de222efe437027c73cd086eaf29ed9921f1b221.tar.bz2
micronucleus-0de222efe437027c73cd086eaf29ed9921f1b221.zip
commandline: fixes --erase-only so it actually works
Diffstat (limited to 'commandline')
-rw-r--r--commandline/examples/micronucleus.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/commandline/examples/micronucleus.c b/commandline/examples/micronucleus.c
index 0f2000c..f77863f 100644
--- a/commandline/examples/micronucleus.c
+++ b/commandline/examples/micronucleus.c
@@ -119,6 +119,7 @@ int main(int argc, char **argv) {
use_ansi = 0;
} else if (strcmp(argv[arg_pointer], "--erase-only") == 0) {
erase_only = 1;
+ progress_total_steps -= 1;
} else if (strcmp(argv[arg_pointer], "--timeout") == 0) {
arg_pointer += 1;
if (sscanf(argv[arg_pointer], "%d", &timeout) != 1) {
@@ -224,16 +225,6 @@ int main(int argc, char **argv) {
printProgress(1.0);
- if (startAddress >= endAddress) {
- printf("> No data in input file, exiting.\n");
- return EXIT_FAILURE;
- }
-
- if (endAddress > my_device->flash_size) {
- printf("> Program file is %d bytes too big for the bootloader!\n", endAddress - my_device->flash_size);
- return EXIT_FAILURE;
- }
-
setProgressData("erasing", 4);
printf("> Erasing the memory ...\n");
res = micronucleus_eraseFlash(my_device, printProgress);