changeset 8:5441581186f8

rm sleeps and shutdown code
author drewp@bigasterisk.com
date Sun, 05 Feb 2023 14:31:21 -0800
parents 25f0c04e1654
children 7e19dffb767b
files telemetrix_local.py
diffstat 1 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/telemetrix_local.py	Sun Feb 05 14:30:44 2023 -0800
+++ b/telemetrix_local.py	Sun Feb 05 14:31:21 2023 -0800
@@ -377,7 +377,7 @@
             command = [PrivateConstants.GET_FEATURES]
             log.debug('send get_features')
             await self._send_command(command)
-            time.sleep(.5)
+            # time.sleep(.5)
 
             # Have the server reset its data structures
             command = [PrivateConstants.RESET]
@@ -807,12 +807,6 @@
         The pin_type for digital input pins with pullups enabled = 11
 
         """
-        if not callback:
-            if self.shutdown_on_exception:
-                await self.shutdown()
-            raise RuntimeError(
-                'set_pin_mode_digital_input_pullup: A callback function must be specified.')
-
         await self._set_pin_mode(pin_number, PrivateConstants.AT_INPUT_PULLUP,
                                  differential=0, callback=callback)
 
@@ -1436,8 +1430,6 @@
                     await self.shutdown()
                 raise RuntimeError('Unknown pin state')
 
-
-        await asyncio.sleep(.05)
         await self._send_command(command)
 
 
@@ -2073,8 +2065,6 @@
 
                 time.sleep(.5)
 
-                await self.serial_port.reset_input_buffer()
-                await self.serial_port.close()
                 if self.close_loop_on_shutdown:
                     self.loop.stop()
             elif self.sock:
@@ -2136,7 +2126,6 @@
 
         :param pin: Pin number.
         """
-
         log.debug(f'enable_digital_reporting {pin=}')
         command = [PrivateConstants.MODIFY_REPORTING, PrivateConstants.REPORTING_DIGITAL_ENABLE, pin]
         await self._send_command(command)
@@ -2159,7 +2148,6 @@
 
             report = packet[0]
             await self.report_dispatch[report](packet[1:])
-            await asyncio.sleep(self.sleep_tune)
 
     '''
     Report message handlers
@@ -2500,7 +2488,6 @@
         if not has_response:
             return None
         else:
-            # await asyncio.sleep(.1)
             header = await self.serial_port.read(1)
             packet_length = header[0]
             pkt = await self.serial_port.read(packet_length)