Commit 9a5ea80c authored by TMRh20's avatar TMRh20

Bugfix: Deadlocks due to RPi SPI mutex code

- SPI transfern function calls transfernb function so a deadlock was
occurring when a lock was attempted prior to the call
- Thread should be unlocked before returning if bcm2835_init() fails
parent 243e25f2
......@@ -10,6 +10,7 @@ SPI::SPI() {
void SPI::begin( int busNo ) {
spiNoInterrupts();
if (!bcm2835_init()){
spiInterrupts();
return;
}
......
......@@ -50,9 +50,7 @@ void SPI::transfernb(char* tbuf, char* rbuf, uint32_t len){
void SPI::transfern(char* buf, uint32_t len)
{
spiNoInterrupts();
transfernb(buf, buf, len);
spiInterrupts();
}
/**
* \endcond
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment