]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/nova/spi.py
lint by black
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / nova / spi.py
index c9f49a441ed1ff1a157bb27a64f449cf0c5b27bd..72f084fd3b4f8e2600bbc990619b66f0c4aa4892 100644 (file)
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
 """SPI Class for Binho Nova"""
 from adafruit_blinka.microcontroller.nova import Connection
 
 """SPI Class for Binho Nova"""
 from adafruit_blinka.microcontroller.nova import Connection
 
@@ -139,7 +142,7 @@ class SPI:
                     self.get_received_data(self._nova.transferSPI(0, write_value))
                 )
 
                     self.get_received_data(self._nova.transferSPI(0, write_value))
                 )
 
-    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-arguments,too-many-locals,too-many-branches
     def write_readinto(
         self, buffer_out, buffer_in, out_start=0, out_end=None, in_start=0, in_end=None
     ):
     def write_readinto(
         self, buffer_out, buffer_in, out_start=0, out_end=None, in_start=0, in_end=None
     ):
@@ -177,9 +180,9 @@ class SPI:
                     # loop over half of resp len as we're reading 2 chars at a time to form a byte
                     loops = int(len(resp) / 2)
                     for j in range(loops):
                     # loop over half of resp len as we're reading 2 chars at a time to form a byte
                     loops = int(len(resp) / 2)
                     for j in range(loops):
-                        buffer_in[
-                            (i * self.WHR_PAYLOAD_MAX_LENGTH) + in_start + j
-                        ] = int(resp[j * 2] + resp[j * 2 + 1], 16)
+                        buffer_in[(i * self.WHR_PAYLOAD_MAX_LENGTH) + in_start + j] = (
+                            int(resp[j * 2] + resp[j * 2 + 1], 16)
+                        )
                 else:
                     raise RuntimeError(
                         "Received error response from Binho Nova, result = " + result
                 else:
                     raise RuntimeError(
                         "Received error response from Binho Nova, result = " + result
@@ -195,9 +198,9 @@ class SPI:
                     # loop over half of resp len as we're reading 2 chars at a time to form a byte
                     loops = int(len(resp) / 2)
                     for j in range(loops):
                     # loop over half of resp len as we're reading 2 chars at a time to form a byte
                     loops = int(len(resp) / 2)
                     for j in range(loops):
-                        buffer_in[
-                            (i * self.WHR_PAYLOAD_MAX_LENGTH) + in_start + j
-                        ] = int(resp[j * 2] + resp[j * 2 + 1], 16)
+                        buffer_in[(i * self.WHR_PAYLOAD_MAX_LENGTH) + in_start + j] = (
+                            int(resp[j * 2] + resp[j * 2 + 1], 16)
+                        )
                 else:
                     raise RuntimeError(
                         "Received error response from Binho Nova, result = " + result
                 else:
                     raise RuntimeError(
                         "Received error response from Binho Nova, result = " + result
@@ -212,4 +215,4 @@ class SPI:
                     buffer_in[in_start + i] = data_in
                 i += 1
 
                     buffer_in[in_start + i] = data_in
                 i += 1
 
-    # pylint: enable=too-many-arguments
+    # pylint: enable=too-many-arguments,too-many-locals,too-many-branches