summaryrefslogtreecommitdiffstats
path: root/libtoprammer/main.py
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-04-28 20:28:10 +0200
committerMichael Buesch <m@bues.ch>2012-04-28 20:28:10 +0200
commit2ca5fa7f9a01b09ad1c1a1b8aac03b73d12bd53e (patch)
tree71a447925059ebadfd1d92f6587cf1fc92ab0c4e /libtoprammer/main.py
parent654428c1aeaa9c775a62269951e459ecef614505 (diff)
downloadtoprammer-2ca5fa7f9a01b09ad1c1a1b8aac03b73d12bd53e.tar.xz
toprammer-2ca5fa7f9a01b09ad1c1a1b8aac03b73d12bd53e.zip
Cleanups
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/main.py')
-rw-r--r--libtoprammer/main.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/libtoprammer/main.py b/libtoprammer/main.py
index 6c7098f..a97dbb4 100644
--- a/libtoprammer/main.py
+++ b/libtoprammer/main.py
@@ -252,9 +252,10 @@ class TOP(object):
self.hw.FPGAInitiateConfig()
data = self.bitfile.getPayload()
- chunksz = self.hw.FPGAMaxConfigChunkSize()
+ chunksz = self.hw.getFPGAMaxConfigChunkSize()
+ chunksz = chunksz if chunksz > 0 else len(data)
for i in range(0, len(data), chunksz):
- self.hw.FPGAUploadConfig(data[i : i + chunksz])
+ self.hw.FPGAUploadConfig(i, data[i : i + chunksz])
self.flushCommands()
if requiredID and requiredRevision:
@@ -382,7 +383,7 @@ class TOP(object):
def hostDelay(self, seconds):
"""Flush all commands and delay the host computer for 'seconds'"""
- self.hw.flushCommands(seconds)
+ self.flushCommands(seconds)
def getOscillatorHz(self):
"""Returns the FPGA oscillator frequency, in Hz.
@@ -468,5 +469,6 @@ class TOP(object):
"""Enable the ZIF socket signal pullups."""
self.hw.enableZifPullups(enable)
- def flushCommands(self):
- self.hw.flushCommands()
+ def flushCommands(self, sleepSeconds=0):
+ """Flush command queue and optionally sleep for 'sleepSeconds'."""
+ self.hw.flushCommands(sleepSeconds)
bues.ch cgit interface