Skip to content

SPI: Prevent SPI.end() from hanging before initialization - #551

Open
JudjinGM wants to merge 1 commit into
arduino:mainfrom
JudjinGM:fix/spi-end-before-begin
Open

SPI: Prevent SPI.end() from hanging before initialization#551
JudjinGM wants to merge 1 commit into
arduino:mainfrom
JudjinGM:fix/spi-end-before-begin

Conversation

@JudjinGM

@JudjinGM JudjinGM commented Jul 30, 2026

Copy link
Copy Markdown

Calling SPI.end() before SPI.begin() causes the board to become unresponsive.

ArduinoSPI::end() calls the _close function pointer even when SPI has not been initialized. The _close pointer is assigned during SPI.begin(), so it is not valid before initialization.

This change makes ArduinoSPI::end() return early when _is_initialized is false.

Fixes: #552

@CLAassistant

CLAassistant commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

SPI: SPI.end() before SPI.begin() causes the board to become unresponsive

2 participants