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

enable I2C by default #5776

Closed
wants to merge 3 commits into from
Closed

enable I2C by default #5776

wants to merge 3 commits into from

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Dec 23, 2021

folks can always turn it off to save power later

@ladyada ladyada requested a review from dhalbert December 23, 2021 23:21
@ladyada
Copy link
Member Author

ladyada commented Dec 24, 2021

@dhalbert this enables i2c by default

dhalbert
dhalbert previously approved these changes Dec 24, 2021
Copy link
Collaborator

@dhalbert dhalbert left a comment

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

Copy link
Collaborator

@dhalbert dhalbert left a comment

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
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