Skip to content

enable I2C by default#5776

Closed
ladyada wants to merge 3 commits into
adafruit:mainfrom
ladyada:main
Closed

enable I2C by default#5776
ladyada wants to merge 3 commits into
adafruit:mainfrom
ladyada:main

Conversation

@ladyada

@ladyada ladyada commented Dec 23, 2021

Copy link
Copy Markdown
Member

folks can always turn it off to save power later

@ladyada ladyada requested a review from dhalbert December 23, 2021 23:21
@ladyada

ladyada commented Dec 24, 2021

Copy link
Copy Markdown
Member Author

@dhalbert this enables i2c by default

dhalbert
dhalbert previously approved these changes Dec 24, 2021

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This will enabled I2C power after a hard reset, but will not change the pin state after a soft reload. For that we would add it to reset_board().

So if you disabled power in boot.py by setting the pin high, it will stay high. Maybe this is what we want. If we moved pin setting to code.py, it would get changed every time code.py started.

I think that makes sense. It is similar to the CPB, which also turns off stuff on hard reset, but doesn't adjust it on each soft reload.

This fix is in main, not 7.1.x. Do you want it backported to 7.1.x? (Probably a good idea).

@dhalbert dhalbert dismissed their stale review December 24, 2021 01:41

needs fixing

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Test program that uses D7 gives this error on soft reboot:

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 6, in <module>
ValueError: D7 in use

@dhalbert

Copy link
Copy Markdown
Collaborator

Closing in favor of #5779, which is a near duplicate, but against 7.1.x instead of main. I was unable to reproduce the error above after further testing with #5779.

@dhalbert dhalbert closed this Dec 24, 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.

2 participants