1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-22 07:45:24 +03:00

Disambiguate MAX_MOTORS and MAX_SUPPORTED_MOTORS

Achieved by renaming MAX_MOTORS to MAX_PWM_MOTORS

Disambiguate MAX_MOTORS and MAX_SUPPORTED_SERVOS
Achieved by renaming MAX_SERVOS to MAX_PWM_SERVOS

It now shows there is a dependency on the pwm driver if MAX_PWM_* is
used.

Coupled pwm_common and timer_common by using USABLE_TIMER_CHANNEL_COUNT
since the current pwm driver and timer driver is only usable by the
STM32F103.
This commit is contained in:
Dominic Clifton 2014-04-23 21:04:39 +01:00
parent a5f0999c26
commit aa84439b21
8 changed files with 25 additions and 24 deletions

View file

@ -425,7 +425,7 @@ static void evaluateCommand(void)
break;
case MSP_SERVO_CONF:
headSerialReply(56);
for (i = 0; i < MAX_SERVOS; i++) {
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
serialize16(currentProfile.servoConf[i].min);
serialize16(currentProfile.servoConf[i].max);
serialize16(currentProfile.servoConf[i].middle);
@ -434,12 +434,12 @@ static void evaluateCommand(void)
break;
case MSP_SET_SERVO_CONF:
headSerialReply(0);
for (i = 0; i < MAX_SERVOS; i++) {
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
currentProfile.servoConf[i].min = read16();
currentProfile.servoConf[i].max = read16();
// provide temporary support for old clients that try and send a channel index instead of a servo middle
uint16_t potentialServoMiddleOrChannelToForward = read16();
if (potentialServoMiddleOrChannelToForward < MAX_SERVOS) {
if (potentialServoMiddleOrChannelToForward < MAX_SUPPORTED_SERVOS) {
currentProfile.servoConf[i].forwardFromChannel = potentialServoMiddleOrChannelToForward;
}
if (potentialServoMiddleOrChannelToForward >= PWM_RANGE_MIN && potentialServoMiddleOrChannelToForward <= PWM_RANGE_MAX) {
@ -450,13 +450,13 @@ static void evaluateCommand(void)
break;
case MSP_CHANNEL_FORWARDING:
headSerialReply(8);
for (i = 0; i < MAX_SERVOS; i++) {
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
serialize8(currentProfile.servoConf[i].forwardFromChannel);
}
break;
case MSP_SET_CHANNEL_FORWARDING:
headSerialReply(0);
for (i = 0; i < MAX_SERVOS; i++) {
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
currentProfile.servoConf[i].forwardFromChannel = read8();
}
break;