aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/device
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-11-23 22:52:37 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-11-23 22:52:37 +0100
commitb1bc5e0e461856ca8f1cc532eb2023ddbe2cb957 (patch)
treee56b7ced5928fac51c83754652a105529c38979c /apps/drivers/device
parent0193d590db92b96e93de9594b7db75a2c7805de6 (diff)
downloadpx4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.tar.gz
px4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.tar.bz2
px4-firmware-b1bc5e0e461856ca8f1cc532eb2023ddbe2cb957.zip
Improved drivers, allowed parallel use of multiple gyros
Diffstat (limited to 'apps/drivers/device')
-rw-r--r--apps/drivers/device/spi.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/drivers/device/spi.cpp b/apps/drivers/device/spi.cpp
index 63c7c12aa..8fffd60cb 100644
--- a/apps/drivers/device/spi.cpp
+++ b/apps/drivers/device/spi.cpp
@@ -86,7 +86,7 @@ SPI::init()
{
int ret = OK;
- // attach to the spi bus
+ /* attach to the spi bus */
if (_dev == nullptr)
_dev = up_spiinitialize(_bus);
@@ -96,7 +96,10 @@ SPI::init()
goto out;
}
- // call the probe function to check whether the device is present
+ /* deselect device to ensure high to low transition of pin select */
+ SPI_SELECT(_dev, _device, false);
+
+ /* call the probe function to check whether the device is present */
ret = probe();
if (ret != OK) {
@@ -104,7 +107,7 @@ SPI::init()
goto out;
}
- // do base class init, which will create the device node, etc.
+ /* do base class init, which will create the device node, etc. */
ret = CDev::init();
if (ret != OK) {
@@ -112,7 +115,7 @@ SPI::init()
goto out;
}
- // tell the workd where we are
+ /* tell the workd where we are */
log("on SPI bus %d at %d", _bus, _device);
out: