call reset_all_pins() in main() after port_init()#10843
Merged
tannewt merged 1 commit intoadafruit:10.1.xfrom Feb 23, 2026
Merged
call reset_all_pins() in main() after port_init()#10843tannewt merged 1 commit intoadafruit:10.1.xfrom
tannewt merged 1 commit intoadafruit:10.1.xfrom
Conversation
Before adafruit#10699, `reset_all_pins()` was called in `reset_port()`. That changed to reset all pins in main after the finalizers ran. However, this mean that pins were not all reset on power-up or hard reset. This caused adafruit#1841, because the power control pin for Feather S3 TFT was not powering the display as required before the display was reset. Add a call to `reset_all_pins()` early in `main()` to serve the same purpose.
Collaborator
Author
|
I tested pin alarms on a MagTag with this build, and they are still working fine. (There is delay before they are registered -- that is some startup delay, but this has been true since at least 9.2.9. Maybe that should be looked at.) |
Collaborator
Author
|
@tannewt I changed the merge base to 10.1x. |
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.
Before #10699,
reset_all_pins()was called inreset_port(). That PR changed things to reset all pins inmain()after the finalizers ran. However, that change only handled pin reset after the VM stopped, and not on power-up or hard reset.
This caused #10841, because the power control pin for Feather S3 TFT was not powering the display as
required before the display was reset. (It's not clear why this only affected older boards, but it may have to do with the some better power-on state of the display on newer boards.)
reset_all_pins()early inmain()to now make sure that pins are reset properly.atmel-samdport_init().It is worth testing this on various boards with various special pin behaviors to make sure it doesn't break things like deep sleep pin preservation and pin alarm reporting. I will do some testing on MagTag with deep sleep.