Skip to content
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

Fix issue #109, SPI needs to read register SPI_USER(SPI_NO) instead o… #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtavenrath
Copy link

…f using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32

@mtavenrath
Copy link
Author

@harry-boe Can you check if this fix also works with the SDCard library?

I think this fix is better than initializing mySettings._user_regvalue with the value of mySettings._user_regvalue = SPI_USER(SPI_NO);

The alternate fix I haven't tried yet would be reading the register SPI_USER(SPI_NO) instead of using the value SPI_USER(SPI_NO) though I don't see why this is more useful unless we want to restore the original value in endTransaction.

@harry-boe
Copy link
Contributor

It might work that way but it will break wit the idea to preserve the register for multiple SPI clients with different Settings (i.e. Register Values)

@Phaeodaria Phaeodaria force-pushed the issue_109 branch 2 times, most recently from 004cfa5 to 0c87357 Compare May 18, 2016 20:32
…nstead of using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32
@mtavenrath
Copy link
Author

The code now preserves the user register in beginTransaction and restores it in endTransaction.

@harry-boe
Copy link
Contributor

From the logic side this should work as well.
Unfortunately i have no time for testing. Did you tested that case with multiple devices ?

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