AP_Compass: setup read flag for SPI transfers

This commit is contained in:
Andrew Tridgell 2016-11-06 20:57:51 +11:00
parent 18df213069
commit fac895b0e6
1 changed files with 4 additions and 0 deletions

View File

@ -479,6 +479,10 @@ bool AP_Compass_HMC5843::_calibrate()
AP_HMC5843_BusDriver_HALDevice::AP_HMC5843_BusDriver_HALDevice(AP_HAL::OwnPtr<AP_HAL::Device> dev)
: _dev(std::move(dev))
{
// set read and auto-increment flags on SPI
if (_dev->bus_type() == AP_HAL::Device::BUS_TYPE_SPI) {
_dev->set_read_flag(0xC0);
}
}
bool AP_HMC5843_BusDriver_HALDevice::block_read(uint8_t reg, uint8_t *buf, uint32_t size)