fpga: Fix some corner case errors and keywords

It was possible for the quiesce loop to end early before the initial
delay, which would cause result to be undefined and fail.

Change-Id: Ia09348c495700e7ea1e163d4c17ddda309561f55
diff --git a/FPGALibrary.py b/FPGALibrary.py
index 841b250..4765a17 100644
--- a/FPGALibrary.py
+++ b/FPGALibrary.py
@@ -33,7 +33,7 @@
     """
     ser = serial.Serial(port=device,
                         timeout=timeout,
-                        write_timeout=write_timeout
+                        write_timeout=write_timeout,
                         baudrate=baudrate)
     if not ser.is_open:
         raise AssertionError(f"Could not open {device}!")
@@ -71,6 +71,8 @@
         self.timeout = None
         if kwargs.get('timeout'):
             self.timeout = float(kwargs['timeout'])
+        if kwargs.get('quiesce_delay_seconds'):
+            self.quiesce_delay_seconds = float(kwargs['quiesce_delay_seconds'])
 
         self.smc_uart = f"/dev/Nexus-CP210-FPGA-UART-{self.board_id}"
         self.sc_uart = f"/dev/Nexus-FTDI-{self.board_id}-FPGA-UART"
@@ -101,12 +103,15 @@
         # Loop while there is data available on the port, then delay
         # for a second to make sure we've actually caught all of the
         # incoming data.
-        while port.in_waiting > 0:
+        result = ''
+        while True:
             info(f"_quiesce_input: port.read({port.in_waiting})")
-            result += port.read(port.in_waiting)
-            info("_quiesce_input: sleep(1)")
-            time.sleep(1)
-        info(f"_quiesce_input read: [{result.decode()}]")
+            result += port.read(port.in_waiting).decode()
+            info(f"_quiesce_input: sleep({self.quiesce_delay_seconds})")
+            time.sleep(self.quiesce_delay_seconds)
+            if port.in_waiting == 0:
+                break
+        info(f"_quiesce_input read: [{result}]")
 
     def _write_string_to_uart(self, port, s, wait_for_echo=True) -> None:
         """
@@ -213,11 +218,11 @@
         Robot keyword. Can be called as Open Serial Ports.
         """
         self.uarts['sc'] = OpenSerialPort(self.sc_uart,
-                                          read_timeout=self.timeout,
+                                          timeout=self.timeout,
                                           write_timeout=self.timeout,
                                           baudrate=115200)
         self.uarts['smc'] = OpenSerialPort(self.smc_uart,
-                                           read_timeout=self.timeout,
+                                           timeout=self.timeout,
                                            write_timeout=self.timeout,
                                            baudrate=115200)
         self.default_uart = self.uarts['smc']