Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write_then_readinto in adafruit_bus_device I2CDevice #4146

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

gamblor21
Copy link
Member

If the out_end optional keyword was omitted the keyword array skipped to indexes leading to parsing confusion.

Copy link
Collaborator

@jerryneedell jerryneedell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested fix with si7021 on MAgTag
It was failing prior to fix with:

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-127-ga10ce39ae on 2021-02-06; Adafruit MagTag with ESP32S2
>>> 
>>> import board
>>> import adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_si7021.py", line 110, in __init__
  File "adafruit_si7021.py", line 107, in __init__
  File "adafruit_si7021.py", line 107, in __init__
TypeError: extra keyword arguments given
>>> 

with this PR it works normally

@jerryneedell
Copy link
Collaborator

jerryneedell commented Feb 6, 2021

odd behavior with this PR -- not sure if it is related to the PR...
It works normally after a power cycle, but not after a soft reboot.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> import board,adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.


Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.1-14-gea4a12005-dirty on 2021-02-06; Adafruit MagTag with ESP32S2
>>> 
>>> import board,adafruit_si7021
>>> sht = adafruit_si7021.SI7021(board.I2C())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_si7021.py", line 99, in __init__
ValueError: No I2C device at address: 40
>>> 

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but I didn't do any testing.

@jerryneedell
Copy link
Collaborator

the issue with the soft reboot is reproducible on a metro_esp32s2 but it does not occur on a PyPortal
I'll open a new issue for that

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 8, 2021

@jerryneedell Is this particular PR good to merge, or are you still investigating?

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 8, 2021

@gamblor21 says good to merge.

@dhalbert dhalbert merged commit f66caa2 into adafruit:main Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants