mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
Changed variable type and used cpp array init.
This commit is contained in:
@@ -7,12 +7,13 @@ constexpr uint32_t CameraInterfaceGPIO::_gpios[6];
|
|||||||
|
|
||||||
CameraInterfaceGPIO::CameraInterfaceGPIO():
|
CameraInterfaceGPIO::CameraInterfaceGPIO():
|
||||||
CameraInterface(),
|
CameraInterface(),
|
||||||
_trigger_invert(false)
|
_trigger_invert(false),
|
||||||
|
_triggers{0}
|
||||||
{
|
{
|
||||||
_p_polarity = param_find("TRIG_POLARITY");
|
_p_polarity = param_find("TRIG_POLARITY");
|
||||||
|
|
||||||
// polarity of the trigger (0 = active low, 1 = active high )
|
// polarity of the trigger (0 = active low, 1 = active high )
|
||||||
int polarity;
|
int32_t polarity;
|
||||||
param_get(_p_polarity, &polarity);
|
param_get(_p_polarity, &polarity);
|
||||||
_trigger_invert = (polarity == 0);
|
_trigger_invert = (polarity == 0);
|
||||||
|
|
||||||
@@ -26,8 +27,6 @@ CameraInterfaceGPIO::~CameraInterfaceGPIO()
|
|||||||
|
|
||||||
void CameraInterfaceGPIO::setup()
|
void CameraInterfaceGPIO::setup()
|
||||||
{
|
{
|
||||||
memset(_triggers, 0, sizeof(_triggers));
|
|
||||||
|
|
||||||
for (unsigned i = 0, t = 0; i < arraySize(_pins); i++) {
|
for (unsigned i = 0, t = 0; i < arraySize(_pins); i++) {
|
||||||
|
|
||||||
// Pin range is from 1 to 6, indexes are 0 to 5
|
// Pin range is from 1 to 6, indexes are 0 to 5
|
||||||
|
|||||||
Reference in New Issue
Block a user