mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
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:
parent
f37a560295
commit
7b39f3d0a7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user