diff options
author | cpldcpu <cpldcpu@gmail.com> | 2014-03-16 09:36:39 +0100 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2014-03-16 09:36:39 +0100 |
commit | 742d11bb63bfa7f107a7e7fb6956e4e8297c7172 (patch) | |
tree | cd91c5e70dbd004671631aeb15393153bde9e197 | |
parent | a6ddfb278eba3c2864530458e46716ebb6b18c7b (diff) | |
download | micronucleus-742d11bb63bfa7f107a7e7fb6956e4e8297c7172.tar.gz micronucleus-742d11bb63bfa7f107a7e7fb6956e4e8297c7172.tar.bz2 micronucleus-742d11bb63bfa7f107a7e7fb6956e4e8297c7172.zip |
commandline: fixed fast mode
-rw-r--r-- | commandline/builds/Windows/micronucleus.exe | bin | 27150 -> 27150 bytes | |||
-rw-r--r-- | commandline/library/micronucleus_lib.c | 18 |
2 files changed, 9 insertions, 9 deletions
diff --git a/commandline/builds/Windows/micronucleus.exe b/commandline/builds/Windows/micronucleus.exe Binary files differindex 4f17f99..45c8b2d 100644 --- a/commandline/builds/Windows/micronucleus.exe +++ b/commandline/builds/Windows/micronucleus.exe 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; + } } } } |