mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
pmw3901 driver: lock bus during transfers (avoid conflicts with sd card on crazyflie)
This commit is contained in:
committed by
Beat Küng
parent
b822966e8e
commit
2359b73d1f
@@ -342,6 +342,9 @@ PMW3901::init()
|
|||||||
{
|
{
|
||||||
int ret = PX4_ERROR;
|
int ret = PX4_ERROR;
|
||||||
|
|
||||||
|
/* For devices competing with NuttX SPI drivers on a bus (Crazyflie SD Card expansion board) */
|
||||||
|
SPI::set_lockmode(LOCK_THREADS);
|
||||||
|
|
||||||
/* do I2C init (and probe) first */
|
/* do I2C init (and probe) first */
|
||||||
if (SPI::init() != OK) {
|
if (SPI::init() != OK) {
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
Reference in New Issue
Block a user