Compare commits
2 Commits
v1.2
...
stc15-baud
Author | SHA1 | Date | |
---|---|---|---|
b4c7f34d39 | |||
65a7759647 |
@ -891,8 +891,6 @@ class Stc12BaseProtocol(StcBaseProtocol):
|
||||
response = self.read_packet()
|
||||
if response[0] != 0x00:
|
||||
raise StcProtocolException("incorrect magic in write packet")
|
||||
elif response[1] != csum:
|
||||
raise StcProtocolException("verification checksum mismatch")
|
||||
print(".", end="")
|
||||
sys.stdout.flush()
|
||||
print(" done")
|
||||
@ -1295,7 +1293,7 @@ class Stc15Protocol(Stc15AProtocol):
|
||||
# This is a bit of a hack, but it works.
|
||||
bauds = self.baud_transfer if (self.mcu_magic >> 8) == 0xf2 else self.baud_transfer * 4
|
||||
packet += struct.pack(">H", int(65535 - program_speed / bauds))
|
||||
packet += struct.pack(">H", int(65535 - (program_speed / bauds) * 1.5))
|
||||
packet += bytes(user_trim)
|
||||
iap_wait = self.get_iap_delay(program_speed)
|
||||
packet += bytes([iap_wait])
|
||||
self.write_packet(packet)
|
||||
|
Reference in New Issue
Block a user