Commit Graph

60 Commits

Author SHA1 Message Date
Grigori Goronzy
11b165c02c stc15a: set pulse timeout for handshake 2015-12-11 00:40:22 +01:00
Grigori Goronzy
9f42ef29f3 stc15: use generic/new sync sequence for handshake
Use the newer sync sequence. Refactor the pulse() function to make
it somewhat generic, so we can use it without worrying about writing
the exactly right number of bytes.

This seems to get STC15W4 series chips working.
2015-12-11 00:39:59 +01:00
Grigori Goronzy
e0afd851ae Let MCU detection recover faster
Use small timeouts to recover faster if there is a misdetection for
whatever reason (truncated packet, user program toggles port, etc.).
2015-11-25 22:19:54 +01:00
Grigori Goronzy
0ed9ac9229 stc15a,stc15: properly set IAP wait states
Refactor the old code from stc12a/stc12 and use it in stc15a/stc15
to set the IAP wait states. Verified by timing the erase time.
2015-11-24 23:13:21 +01:00
Grigori Goronzy
778cb63e36 stc15: add optional write finish packet (BSL 7.2+) 2015-11-24 21:00:56 +01:00
Grigori Goronzy
b55fc1fcf4 stc15: print BSL minor version
The BSL version has the form X.Y.ZW in newer BSLs. The extra digit
is stored in another info packet byte. Print the version correctly.
2015-11-24 20:48:48 +01:00
Grigori Goronzy
d318384c25 stc15: handle uncalibrated chips 2015-11-24 01:37:22 +01:00
Grigori Goronzy
ad57488e4f Unify options
Eradicate inconsistencies, get it in sync with docs.
2015-11-23 23:30:29 +01:00
Grigori Goronzy
bc6447fdc9 Add missing stdout flush calls
This makes the progress display much more useful.
2015-11-23 22:23:50 +01:00
Grigori Goronzy
bc242390e7 Add packaging infrastructure
Split up single script into a package with multiple modules.
Also add a setuptools control file. With this, stcgal can be
installed like any other program. It's still possible to launch
from the sources directly. stcgal.py has been converted into a
simple launcher.

v2: fix imports
2015-11-23 22:19:06 +01:00