Skip to content

Conversation

makermelissa
Copy link
Collaborator

@makermelissa makermelissa commented Sep 11, 2020

Fixes #98. This adds a simple caching mechanism by storing the in the class and returning it from cache after the first time. I noted that it went from attempting to detect the FT232H 6 times down to 1 with this strategy when using import board. The root cause for the issue was that any time we called things like any_raspberry_pi_40_pin, it would have to fetch the chip ID, which was causing it to run all detection routines again. This avoids it unnecessarily running all the routines again, but gives it the value it needs.

@makermelissa makermelissa requested a review from a team September 11, 2020 16:04
@makermelissa
Copy link
Collaborator Author

I removed the github tag to automatically close the issue because I want to see if there's any improvements that could be made on the Blinka side first.

@makermelissa
Copy link
Collaborator Author

Added tag back in. I think this was the most effective change really since Blinka is more of a collection of separate modules rather than a main one that launches stuff.

@makermelissa makermelissa merged commit 89b73da into adafruit:master Sep 11, 2020
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.

chip.py using very inefficient subcall to pyftdi
2 participants