Skip to content

Fix crash when getting board.SPI outside the VM#1756

Merged
dhalbert merged 7 commits intoadafruit:masterfrom
tannewt:fix_cpx_display
Apr 9, 2019
Merged

Fix crash when getting board.SPI outside the VM#1756
dhalbert merged 7 commits intoadafruit:masterfrom
tannewt:fix_cpx_display

Conversation

@tannewt
Copy link
Copy Markdown
Member

@tannewt tannewt commented Apr 6, 2019

If one of the default pins was already in use it would crash.

The internal API has been refined to allow us to get the value
without causing an init of the singleton.

Fixes #1753

If one of the default pins was already in use it would crash.

The internal API has been refined to allow us to get the value
without causing an init of the singleton.

Fixes micropython#1753
@tannewt tannewt added this to the 4.0.0 - Bluetooth milestone Apr 6, 2019
@tannewt tannewt requested a review from dhalbert April 6, 2019 02:09
@ladyada
Copy link
Copy Markdown
Member

ladyada commented Apr 6, 2019

tested and it worked on my cpx!

Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

I get the idea, but some overall comments would help to explain the non-VM lifetime of the spi object.

Some nrf builds are failing, as is gemma (though not trinket) and pirkey.

@tannewt
Copy link
Copy Markdown
Member Author

tannewt commented Apr 9, 2019

Ok, I've refactored everything so it touches many more files. Hopefully it all makes more sense. I did add a gc_never_free which is a catch all linked list from a root pointer for pointers that should live the whole rest of the heap. (Like SPI objects used by FourWire.)

@dhalbert
Copy link
Copy Markdown
Collaborator

dhalbert commented Apr 9, 2019

I did add a gc_never_free which is a catch all linked list from a root pointer for pointers that should live the whole rest of the heap. (Like SPI objects used by FourWire.)

That's a great idea!

Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Just a stale comment to remove. Looks great!

@dhalbert
Copy link
Copy Markdown
Collaborator

dhalbert commented Apr 9, 2019

Bunch of builds failing :(

tannewt added 3 commits April 9, 2019 11:36
It is about 5kb and the pins aren't broken out for it anyway.
USB MIDI was still being compiled in mostly anyway. There is no
place to touch on the board so touchio is useless.
@tannewt
Copy link
Copy Markdown
Member Author

tannewt commented Apr 9, 2019

Ok, I think this next run should pass. I fixed boards without shared busses, removed audiobusio from hallowing and removed touchio from pirkey to gain space back.

@dhalbert dhalbert merged commit 9026f13 into adafruit:master Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants