Skip to content

Commit 0d321db

Browse files
eriknyquistkitsunami
authored andcommitted
CurieIMU.cpp: Don't lock interrupts for SPI transfers
This is unnecessary- nothing else is contending for access to this particular SPI controller
1 parent e870ba2 commit 0d321db

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

libraries/CurieIMU/src/CurieIMU.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -1778,20 +1778,10 @@ bool CurieIMUClass::stepsDetected()
17781778
int CurieIMUClass::serial_buffer_transfer(uint8_t *buf, unsigned tx_cnt,
17791779
unsigned rx_cnt)
17801780
{
1781-
int flags, status;
1782-
17831781
if (rx_cnt) /* For read transfers, assume 1st byte contains register address */
17841782
buf[0] |= (1 << BMI160_SPI_READ_BIT);
17851783

1786-
/* Lock interrupts here to
1787-
* - avoid concurrent access to the SPI bus
1788-
* - avoid delays in SPI transfer due to unrelated interrupts
1789-
*/
1790-
flags = interrupt_lock();
1791-
status = ss_spi_xfer(SPI_SENSING_1, buf, tx_cnt, rx_cnt);
1792-
interrupt_unlock(flags);
1793-
1794-
return status;
1784+
return ss_spi_xfer(SPI_SENSING_1, buf, tx_cnt, rx_cnt);
17951785
}
17961786

17971787
/** Interrupt handler for interrupts from PIN1 on the BMI160

0 commit comments

Comments
 (0)