mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
camera_interface: initialize _p_pin & handle error
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include "camera_interface.h"
|
#include "camera_interface.h"
|
||||||
|
#include <px4_log.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file camera_interface.cpp
|
* @file camera_interface.cpp
|
||||||
@@ -6,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
CameraInterface::CameraInterface():
|
CameraInterface::CameraInterface():
|
||||||
|
_p_pin(PARAM_INVALID),
|
||||||
_pins{}
|
_pins{}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -20,6 +22,11 @@ void CameraInterface::get_pins()
|
|||||||
// Get parameter handle
|
// Get parameter handle
|
||||||
_p_pin = param_find("TRIG_PINS");
|
_p_pin = param_find("TRIG_PINS");
|
||||||
|
|
||||||
|
if (_p_pin == PARAM_INVALID) {
|
||||||
|
PX4_ERR("param TRIG_PINS not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int pin_list;
|
int pin_list;
|
||||||
param_get(_p_pin, &pin_list);
|
param_get(_p_pin, &pin_list);
|
||||||
|
|
||||||
@@ -44,4 +51,4 @@ void CameraInterface::get_pins()
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user