AP_HAL: add get_device-ptr to HAL DeviceMananger API

This commit is contained in:
Peter Barker 2025-03-04 16:23:30 +11:00 committed by Peter Barker
parent 222584fe13
commit a6794d5ec0

View File

@ -68,9 +68,9 @@ public:
class SPIDeviceManager {
public:
virtual OwnPtr<SPIDevice> get_device(const char *name)
{
return nullptr;
virtual SPIDevice *get_device_ptr(const char *name) = 0;
OwnPtr<SPIDevice> get_device(const char *name) {
return AP_HAL::OwnPtr<AP_HAL::SPIDevice>(get_device_ptr(name));
}
/* Return the number of SPI devices currently registered. */