summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commandline/builds/Windows/micronucleus.exebin27150 -> 27150 bytes
-rw-r--r--commandline/library/micronucleus_lib.c18
2 files changed, 9 insertions, 9 deletions
diff --git a/commandline/builds/Windows/micronucleus.exe b/commandline/builds/Windows/micronucleus.exe
index 4f17f99..45c8b2d 100644
--- a/commandline/builds/Windows/micronucleus.exe
+++ b/commandline/builds/Windows/micronucleus.exe
Binary files differ
diff --git a/commandline/library/micronucleus_lib.c b/commandline/library/micronucleus_lib.c
index 4961703..d6b4243 100644
--- a/commandline/library/micronucleus_lib.c
+++ b/commandline/library/micronucleus_lib.c
@@ -76,18 +76,18 @@ micronucleus* micronucleus_connect(int fast_mode) {
if ((nucleus->version.major>=2)&&(!fast_mode)) {
// firmware v2 reports more aggressive write times. Add 2ms if fast mode is not used.
- nucleus->write_sleep = (buffer[3] & 127) + 2;
- if (buffer[3]&128) {
- // if bit 7 of write sleep time is set, divide the erase time by four to
- // accomodate to the 4*page erase of the ATtiny841/441
- nucleus->erase_sleep = nucleus->write_sleep * nucleus->pages / 4;
- } else {
- nucleus->erase_sleep = nucleus->write_sleep * nucleus->pages;
- }
+ nucleus->write_sleep = (buffer[3] & 127) + 2;
} else {
nucleus->write_sleep = (buffer[3] & 127);
- nucleus->erase_sleep = nucleus->write_sleep * nucleus->pages;
}
+
+ // if bit 7 of write sleep time is set, divide the erase time by four to
+ // accomodate to the 4*page erase of the ATtiny841/441
+ if (buffer[3]&128) {
+ nucleus->erase_sleep = nucleus->write_sleep * nucleus->pages / 4;
+ } else {
+ nucleus->erase_sleep = nucleus->write_sleep * nucleus->pages;
+ }
}
}
}