From ecec2d76d9217713c800a48f1be0a886af5bb517 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 20 Mar 2015 21:57:31 +0100 Subject: Allow a bit more flexibility of PWM range --- src/drivers/drv_pwm_output.h | 4 ++-- src/systemcmds/esc_calib/esc_calib.c | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/drivers/drv_pwm_output.h b/src/drivers/drv_pwm_output.h index 35e9619f0..6271ad208 100644 --- a/src/drivers/drv_pwm_output.h +++ b/src/drivers/drv_pwm_output.h @@ -78,7 +78,7 @@ __BEGIN_DECLS /** * Highest PWM allowed as the minimum PWM */ -#define PWM_HIGHEST_MIN 1300 +#define PWM_HIGHEST_MIN 1600 /** * Highest maximum PWM in us @@ -93,7 +93,7 @@ __BEGIN_DECLS /** * Lowest PWM allowed as the maximum PWM */ -#define PWM_LOWEST_MAX 1700 +#define PWM_LOWEST_MAX 1400 /** * Do not output a channel with this value diff --git a/src/systemcmds/esc_calib/esc_calib.c b/src/systemcmds/esc_calib/esc_calib.c index aee26680c..d74010553 100644 --- a/src/systemcmds/esc_calib/esc_calib.c +++ b/src/systemcmds/esc_calib/esc_calib.c @@ -168,8 +168,13 @@ esc_calib_main(int argc, char *argv[]) } } - if (set_mask == 0) + if (set_mask == 0) { usage("no channels chosen"); + } + + if (pwm_low > pwm_high) { + usage("low pwm is higher than high pwm"); + } /* make sure no other source is publishing control values now */ struct actuator_controls_s actuators; -- cgit v1.2.3