From 2ca5fa7f9a01b09ad1c1a1b8aac03b73d12bd53e Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 28 Apr 2012 20:28:10 +0200 Subject: Cleanups Signed-off-by: Michael Buesch --- libtoprammer/main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libtoprammer/main.py') 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) -- cgit v1.2.3