AP_HAL_Linux: do not warn for empty table

../../libraries/AP_HAL_Linux/SPIDevice.cpp: In member function ‘virtual AP_HAL::OwnPtr<AP_HAL::SPIDevice> Linux::SPIDeviceManager::get_device(const char*)’:
../../libraries/AP_HAL_Linux/SPIDevice.cpp:337:27: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     for (uint8_t i = 0; i < _n_device_desc; i++) {
                         ~~^~~~~~~~~~~~~~~~

Define a dummy device to remove warning.
This commit is contained in:
Lucas De Marchi 2016-07-30 00:03:23 -03:00
parent f37a560295
commit 7b39f3d0a7

View File

@ -120,8 +120,10 @@ SPIDesc SPIDeviceManager::_device[] = {
};
#else
// empty device table
SPIDesc SPIDeviceManager::_device[] = { };
#define LINUX_SPI_DEVICE_NUM_DEVICES 0
SPIDesc SPIDeviceManager::_device[] = {
SPIDesc("**dummy**", 0, 0, SPI_MODE_3, 0, 0, 0 * MHZ, 0 * MHZ),
};
#define LINUX_SPI_DEVICE_NUM_DEVICES 1
#endif
#ifndef LINUX_SPI_DEVICE_NUM_DEVICES