Skip to content

Comments

call reset_all_pins() in main() after port_init()#10843

Merged
tannewt merged 1 commit intoadafruit:10.1.xfrom
dhalbert:reset-all-pins-in-main
Feb 23, 2026
Merged

call reset_all_pins() in main() after port_init()#10843
tannewt merged 1 commit intoadafruit:10.1.xfrom
dhalbert:reset-all-pins-in-main

Conversation

@dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Feb 22, 2026

Before #10699, reset_all_pins() was called in reset_port(). That PR changed things to reset all pins in main()
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.)

  • Add a call to reset_all_pins() early in main() to now make sure that pins are reset properly.
  • Remove a now-redundant call in atmel-samd port_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.

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.
@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 23, 2026

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

tannewt
tannewt previously approved these changes Feb 23, 2026
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@dhalbert dhalbert changed the base branch from main to 10.1.x February 23, 2026 18:19
@dhalbert dhalbert dismissed tannewt’s stale review February 23, 2026 18:19

The base branch was changed.

@dhalbert dhalbert requested a review from tannewt February 23, 2026 18:20
@dhalbert
Copy link
Collaborator Author

@tannewt I changed the merge base to 10.1x.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks!

@tannewt tannewt merged commit 7ecbb1b into adafruit:10.1.x Feb 23, 2026
646 checks passed
@dhalbert dhalbert deleted the reset-all-pins-in-main branch February 24, 2026 00:22
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.

ESP32-S3 Reverse TFT Feather board display abnormal behavior on CP v10.1.1 or later

2 participants