]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Display a message if user tries to set freq on linux
authorMelissa LeBlanc-Williams <melissa@adafruit.com>
Tue, 12 Sep 2023 20:05:48 +0000 (13:05 -0700)
committerMelissa LeBlanc-Williams <melissa@adafruit.com>
Tue, 12 Sep 2023 20:05:48 +0000 (13:05 -0700)
.github/ISSUE_TEMPLATE/new_board_request.md
src/adafruit_blinka/microcontroller/generic_linux/i2c.py
src/busio.py

index 6190a2c02310a97c2b91d7a0a3a5aa1b1a16c4eb..02ff5150c5a76d3ffb9388817a69cc83eb229dbe 100644 (file)
@@ -1,5 +1,5 @@
 ---
 ---
-name: ð\9f\9a\80 New Board Request
+name: ð\9f\93\9f New Board Request
 about: Request Support for a New Board
 title: ''
 labels: 'New Board Request'
 about: Request Support for a New Board
 title: ''
 labels: 'New Board Request'
index f6bee20c8f878ab18fbbb08fb620594556dc2cd5..a5db827dc30d422e64924faf1f4f1aa60036fc48 100644 (file)
@@ -6,7 +6,11 @@ from Adafruit_PureIO import smbus
 
 
 class I2C:
 
 
 class I2C:
-    """I2C class"""
+    """
+    I2C class
+
+    Baudrate has no effect on Linux systems. The argument is only there for compatibility.
+    """
 
     MASTER = 0
     SLAVE = 1
 
     MASTER = 0
     SLAVE = 1
@@ -20,8 +24,8 @@ class I2C:
             raise NotImplementedError("Only I2C Master supported!")
         _mode = self.MASTER
 
             raise NotImplementedError("Only I2C Master supported!")
         _mode = self.MASTER
 
-        # if baudrate != None:
-        #    print("I2C frequency is not settable in python, ignoring!")
+        if baudrate is not None:
+            print("I2C frequency is not settable in python, ignoring!")
 
         try:
             self._i2c_bus = smbus.SMBus(bus_num)
 
         try:
             self._i2c_bus = smbus.SMBus(bus_num)
index 2de9e60a69137419a5c734f00d9e179cf27f14c5..e3770a475fefea7da508c5056cfc602c414ff1c9 100644 (file)
@@ -29,6 +29,8 @@ class I2C(Lockable):
     """
     Busio I2C Class for CircuitPython Compatibility. Used
     for both MicroPython and Linux.
     """
     Busio I2C Class for CircuitPython Compatibility. Used
     for both MicroPython and Linux.
+
+    NOTE: Frequency has no effect on Linux systems. The argument is only there for compatibility.
     """
 
     def __init__(self, scl, sda, frequency=100000):
     """
 
     def __init__(self, scl, sda, frequency=100000):