Skip to content

Sh vtol dev#10

Open
shota3527 wants to merge 44 commits into
masterfrom
sh_vtol_dev
Open

Sh vtol dev#10
shota3527 wants to merge 44 commits into
masterfrom
sh_vtol_dev

Conversation

@shota3527
Copy link
Copy Markdown
Owner

No description provided.

sensei-hacker pushed a commit that referenced this pull request May 30, 2026
The CAN1 RX0 interrupt was being enabled at the beginning of the
dronecanSTM32CAN1_Init() function, before all hardware initialization
steps were complete. If any subsequent initialization step failed
(HAL_CAN_Init, HAL_CAN_ConfigFilter, or HAL_CAN_Receive_IT), the
function would return an error while the interrupt remained enabled.

This created a race condition where spurious interrupts could fire on
unconfigured hardware, causing crashes or undefined behavior.

Move the interrupt enable to the end of the function, after all
initialization succeeds. If any step fails, the function returns early
without enabling the interrupt, preventing spurious ISR calls.

This ensures safe failure handling and prevents system crashes from
incomplete hardware initialization.
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.

1 participant