From c66fab01e5b45ea47e5d8bdd1ef3325e5ab5b624 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Apr 2016 18:27:58 +1000 Subject: [PATCH] drv_pwm: expand range of PWM ioctl indexes we had run out of them. _IOC_MASK is 0xFF, so we can add an extra 16 without an issue --- src/drivers/drv_pwm_output.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/drv_pwm_output.h b/src/drivers/drv_pwm_output.h index 3b3cd1830b..76fa35dbf7 100644 --- a/src/drivers/drv_pwm_output.h +++ b/src/drivers/drv_pwm_output.h @@ -247,21 +247,21 @@ struct pwm_output_rc_config { /* * * - * WARNING WARNING WARNING! DO NOT EXCEED 31 IN IOC INDICES HERE! + * WARNING WARNING WARNING! DO NOT EXCEED 47 IN IOC INDICES HERE! * * */ /** set a single servo to a specific value */ -#define PWM_SERVO_SET(_servo) _PX4_IOC(_PWM_SERVO_BASE, 0x20 + _servo) +#define PWM_SERVO_SET(_servo) _PX4_IOC(_PWM_SERVO_BASE, 0x30 + _servo) /** get a single specific servo value */ -#define PWM_SERVO_GET(_servo) _PX4_IOC(_PWM_SERVO_BASE, 0x40 + _servo) +#define PWM_SERVO_GET(_servo) _PX4_IOC(_PWM_SERVO_BASE, 0x50 + _servo) /** get the _n'th rate group's channels; *(uint32_t *)arg returns a bitmap of channels * whose update rates must be the same. */ -#define PWM_SERVO_GET_RATEGROUP(_n) _PX4_IOC(_PWM_SERVO_BASE, 0x60 + _n) +#define PWM_SERVO_GET_RATEGROUP(_n) _PX4_IOC(_PWM_SERVO_BASE, 0x70 + _n) /* * Low-level PWM output interface.