mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
camera_trigger: Use proper types
This commit is contained in:
committed by
Julian Oes
parent
7b2a1d4742
commit
c12a3330b8
@@ -52,8 +52,8 @@ void CameraInterface::get_pins()
|
|||||||
_pins[i] = -1;
|
_pins[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pin_list = 0;
|
int32_t pin_list = 0;
|
||||||
int pin_list_ex = 0;
|
int32_t pin_list_ex = 0;
|
||||||
|
|
||||||
if (_p_pin_ex != PARAM_INVALID) {
|
if (_p_pin_ex != PARAM_INVALID) {
|
||||||
param_get(_p_pin_ex, &pin_list_ex);
|
param_get(_p_pin_ex, &pin_list_ex);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void CameraInterfacePWM::setup()
|
|||||||
// Set neutral pulsewidths
|
// Set neutral pulsewidths
|
||||||
for (unsigned i = 0; i < arraySize(_pins); i++) {
|
for (unsigned i = 0; i < arraySize(_pins); i++) {
|
||||||
if (_pins[i] >= 0) {
|
if (_pins[i] >= 0) {
|
||||||
up_pwm_trigger_set(_pins[i], math::constrain(_pwm_camera_neutral, 0, 2000));
|
up_pwm_trigger_set(_pins[i], math::constrain(_pwm_camera_neutral, (int32_t) 0, (int32_t) 2000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,8 @@ void CameraInterfacePWM::trigger(bool trigger_on_true)
|
|||||||
for (unsigned i = 0; i < arraySize(_pins); i++) {
|
for (unsigned i = 0; i < arraySize(_pins); i++) {
|
||||||
if (_pins[i] >= 0) {
|
if (_pins[i] >= 0) {
|
||||||
// Set all valid pins to shoot or neutral levels
|
// Set all valid pins to shoot or neutral levels
|
||||||
up_pwm_trigger_set(_pins[i], math::constrain(trigger_on_true ? _pwm_camera_shoot : _pwm_camera_neutral, 0, 2000));
|
up_pwm_trigger_set(_pins[i], math::constrain(trigger_on_true ? _pwm_camera_shoot : _pwm_camera_neutral, (int32_t) 0,
|
||||||
|
(int32_t) 2000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user