-
Notifications
You must be signed in to change notification settings - Fork 3k
[HAL] Modified SPI to use shared mutex #2297
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
Conversation
Modified the SPI class to use a shared mutex for all instances. This is consistent with I2C and others.
Thanks for the PR @neilt6. This looks good to me. |
@mbed-bot: TEST HOST_OSES=windows |
/morph test |
Hi, What about MCU with more than 1 SPI controller? |
yes, same as there's only one owner (private member variable). |
[Build 739] |
Then it probably should be: class SPI {
public:
virtual bool lock(uint32_t millisec=osWaitForever) {
return _mutex->lock(millisec) == osOK;
}
} Otherwise any attempt to use SPI methods would lead to wait. |
@anpilog Can you create an issue for this? this might not be just a case for SPI. Shall we discuss this aside from this PR? |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 560 All builds and test passed! |
Ok. |
CI results are good ! |
Modified the
SPI
class to use a shared mutex for all instances in response to #2276. This is consistent withI2C
and others.