Skip to content

[stm32-lvgl] Fix an interrupt safety bug that caused occasional crashes #164

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kubamracek
Copy link
Collaborator

See the added comment that explains the bug.

@kubamracek kubamracek requested a review from rauhul as a code owner July 2, 2025 16:31
@@ -69,13 +69,23 @@ func SystickTimerISR() {
uptimeInMs += 1
}

// The following interrupt set up is trickier that it looks on the surface. The
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The following interrupt set up is trickier that it looks on the surface. The
// The following interrupt set up is trickier than it looks on the surface. The

// ISR Swift code must be "trivial" directly and transitively, and namely it
// must avoid destroying any heap objects (because we could be inside malloc
// when the interrupt hits). For that, the expectation is that
// lcdInterruptVerticalSyncHandler is only ever set once, and it not changing
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// lcdInterruptVerticalSyncHandler is only ever set once, and it not changing
// lcdInterruptVerticalSyncHandler is only ever set once, and it is not changing

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.

3 participants