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

esp-println: avoid double locking when using auto #2567

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Nov 19, 2024

No description provided.

@bugadani bugadani added the skip-changelog No changelog modification needed label Nov 19, 2024
@@ -145,27 +145,19 @@ mod auto_printer {
unsafe { (USB_DEVICE_INT_RAW.read_volatile() & SOF_INT_MASK) != 0 }
}

pub fn write_bytes_assume_cs(bytes: &[u8]) {
pub fn write_bytes_in_cs(bytes: &[u8], token: LockToken<'_>) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the record: LockToken was introduced explicitly to clean up the double-locking here - by making it obvious that we're already in with.

@bugadani
Copy link
Contributor Author

Ah damn println doesn't depend on esp-hal :/

@bugadani bugadani changed the title Use a separate lock in esp-println esp-println: avoid double locking when using auto Nov 19, 2024
@bugadani bugadani force-pushed the println-lock branch 5 times, most recently from 89c0e1b to e2cda55 Compare November 19, 2024 15:45
@bjoernQ
Copy link
Contributor

bjoernQ commented Nov 20, 2024

Ah damn println doesn't depend on esp-hal :/

It was a deliberate decision to not depend on the HAL in esp-println and esp-backtrace - we can reconsider that

@bugadani bugadani marked this pull request as ready for review November 22, 2024 09:36
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Thanks!

@MabezDev MabezDev added this pull request to the merge queue Nov 22, 2024
Merged via the queue into esp-rs:main with commit c1f0c13 Nov 22, 2024
44 checks passed
@bugadani bugadani deleted the println-lock branch November 22, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants