Skip to content

Commit

Permalink
Merge pull request #89 from iNavFlight/update_motor_servo_counts
Browse files Browse the repository at this point in the history
support up to 16 motors and 32 servos
  • Loading branch information
stronnag authored Jul 29, 2024
2 parents 1a90eb2 + 705e5d7 commit c4ea1b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ static void identifyMainFields(flightLog_t *log, flightLogFrameDef_t *frameDef)

if (startsWith(fieldName, "motor[")) {
int motorIndex = atoi(fieldName + strlen("motor["));

if (motorIndex >= 0 && motorIndex < FLIGHT_LOG_MAX_MOTORS) {
log->mainFieldIndexes.motor[motorIndex] = fieldIndex;
}
Expand Down Expand Up @@ -231,9 +230,10 @@ static void identifyMainFields(flightLog_t *log, flightLogFrameDef_t *frameDef)

log->mainFieldIndexes.accSmooth[axisIndex] = fieldIndex;
} else if (startsWith(fieldName, "servo[")) {
int servoIndex = atoi(fieldName + strlen("servo["));

log->mainFieldIndexes.servo[servoIndex] = fieldIndex;
int servoIndex = atoi(fieldName + strlen("servo["));
if (servoIndex >= 0 && servoIndex < FLIGHT_LOG_MAX_SERVOS) {
log->mainFieldIndexes.servo[servoIndex] = fieldIndex;
}
} else if (strcmp(fieldName, "vbatLatest") == 0) {
log->mainFieldIndexes.vbatLatest = fieldIndex;
} else if (strcmp(fieldName, "vbat") == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#define FLIGHT_LOG_FIELD_INDEX_ITERATION 0
#define FLIGHT_LOG_FIELD_INDEX_TIME 1

#define FLIGHT_LOG_MAX_MOTORS 8
#define FLIGHT_LOG_MAX_SERVOS 18
#define FLIGHT_LOG_MAX_MOTORS 16
#define FLIGHT_LOG_MAX_SERVOS 32

typedef enum FirmwareType {
FIRMWARE_TYPE_UNKNOWN = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define BBLTOOLS_VERSION 7.99.0
#define BBLTOOLS_VERSION 7.99.1

#ifdef BLACKBOX_VERSION
#undef BBLTOOLS_VERSION
Expand Down

0 comments on commit c4ea1b9

Please sign in to comment.