Skip to content

Commit

Permalink
tools/litex_term: add sdl_payload_length
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Aug 26, 2019
1 parent 3e30c64 commit 4842bdc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions litex/tools/litex_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def getkey(self):
sfl_magic_req = b"sL5DdSMmkekro\n"
sfl_magic_ack = b"z6IHG7cYDID6o\n"

sfl_payload_length = 251

# General commands
sfl_cmd_abort = b"\x00"
sfl_cmd_load = b"\x01"
Expand Down Expand Up @@ -199,7 +201,7 @@ def upload(self, filename, address):
100*position//length))
sys.stdout.flush()
frame = SFLFrame()
frame_data = data[:251]
frame_data = data[:sfl_payload_length]
frame.cmd = sfl_cmd_load
frame.payload = current_address.to_bytes(4, "big")
frame.payload += frame_data
Expand All @@ -208,7 +210,7 @@ def upload(self, filename, address):
current_address += len(frame_data)
position += len(frame_data)
try:
data = data[251:]
data = data[sfl_payload_length:]
except:
data = []
end = time.time()
Expand Down

0 comments on commit 4842bdc

Please sign in to comment.