From 20cd165476cb78bcfab55391da4e9313feefb9e9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 8 Nov 2016 14:02:31 +1100 Subject: [PATCH] HAL_PX4: allow for missing SPIDevice table entries removed panic --- libraries/AP_HAL_PX4/SPIDevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_PX4/SPIDevice.cpp b/libraries/AP_HAL_PX4/SPIDevice.cpp index 77b6f96585..aac950a2bf 100644 --- a/libraries/AP_HAL_PX4/SPIDevice.cpp +++ b/libraries/AP_HAL_PX4/SPIDevice.cpp @@ -176,7 +176,8 @@ SPIDeviceManager::get_device(const char *name) } } if (device_table[i].name == nullptr) { - AP_HAL::panic("SPI: invalid device name: %s", name); + printf("SPI: Invalid device name: %s\n", name); + return AP_HAL::OwnPtr(nullptr); } SPIDesc &desc = device_table[i];