enable I2C by default#5776
Closed
ladyada wants to merge 3 commits into
Closed
Conversation
Member
Author
|
@dhalbert this enables i2c by default |
dhalbert
previously approved these changes
Dec 24, 2021
dhalbert
left a comment
Collaborator
There was a problem hiding this comment.
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
requested changes
Dec 24, 2021
dhalbert
left a comment
Collaborator
There was a problem hiding this comment.
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
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
folks can always turn it off to save power later