mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 00:35:34 +03:00
[PWM] Increase servo output count to 16
This commit is contained in:
parent
84270a2c1c
commit
23766e485b
4 changed files with 7 additions and 11 deletions
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
#include "build_config.h"
|
#include "build_config.h"
|
||||||
|
|
||||||
#if MAX_PWM_MOTORS != MAX_SUPPORTED_MOTORS
|
#if MAX_MOTORS != MAX_SUPPORTED_MOTORS
|
||||||
#error Motor configuration mismatch
|
#error Motor configuration mismatch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MAX_PWM_SERVOS != MAX_SUPPORTED_SERVOS
|
#if MAX_SERVOS != MAX_SUPPORTED_SERVOS
|
||||||
#error Servo configuration mismatch
|
#error Servo configuration mismatch
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,16 +22,12 @@
|
||||||
#include "flight/servos.h"
|
#include "flight/servos.h"
|
||||||
|
|
||||||
#if defined(TARGET_MOTOR_COUNT)
|
#if defined(TARGET_MOTOR_COUNT)
|
||||||
#define MAX_PWM_MOTORS TARGET_MOTOR_COUNT
|
|
||||||
#define MAX_PWM_SERVOS 8
|
|
||||||
#define MAX_MOTORS TARGET_MOTOR_COUNT
|
#define MAX_MOTORS TARGET_MOTOR_COUNT
|
||||||
#define MAX_SERVOS 8
|
#define MAX_SERVOS 16
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define MAX_PWM_MOTORS 12
|
|
||||||
#define MAX_PWM_SERVOS 8
|
|
||||||
#define MAX_MOTORS 12
|
#define MAX_MOTORS 12
|
||||||
#define MAX_SERVOS 8
|
#define MAX_SERVOS 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PWM_TIMER_HZ 1000000
|
#define PWM_TIMER_HZ 1000000
|
||||||
|
|
|
@ -83,11 +83,11 @@ typedef struct {
|
||||||
|
|
||||||
static pwmOutputPort_t pwmOutputPorts[MAX_PWM_OUTPUT_PORTS];
|
static pwmOutputPort_t pwmOutputPorts[MAX_PWM_OUTPUT_PORTS];
|
||||||
|
|
||||||
static pwmOutputMotor_t motors[MAX_PWM_MOTORS];
|
static pwmOutputMotor_t motors[MAX_MOTORS];
|
||||||
static motorPwmProtocolTypes_e initMotorProtocol;
|
static motorPwmProtocolTypes_e initMotorProtocol;
|
||||||
static pwmWriteFuncPtr motorWritePtr = NULL; // Function to write value to motors
|
static pwmWriteFuncPtr motorWritePtr = NULL; // Function to write value to motors
|
||||||
|
|
||||||
static pwmOutputPort_t * servos[MAX_PWM_SERVOS];
|
static pwmOutputPort_t * servos[MAX_SERVOS];
|
||||||
static pwmWriteFuncPtr servoWritePtr = NULL; // Function to write value to motors
|
static pwmWriteFuncPtr servoWritePtr = NULL; // Function to write value to motors
|
||||||
|
|
||||||
#if defined(USE_DSHOT) || defined(USE_SERIALSHOT)
|
#if defined(USE_DSHOT) || defined(USE_SERIALSHOT)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "config/parameter_group.h"
|
#include "config/parameter_group.h"
|
||||||
#include "common/logic_condition.h"
|
#include "common/logic_condition.h"
|
||||||
|
|
||||||
#define MAX_SUPPORTED_SERVOS 8
|
#define MAX_SUPPORTED_SERVOS 16
|
||||||
|
|
||||||
// These must be consecutive
|
// These must be consecutive
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue