mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Cleanup project structure. Update unit test Makefile to place object
files in obj/test
This commit is contained in:
parent
fb9e3a2358
commit
d19a5e7046
330 changed files with 657 additions and 638 deletions
55
src/main/drivers/pwm_mapping.h
Executable file
55
src/main/drivers/pwm_mapping.h
Executable file
|
@ -0,0 +1,55 @@
|
|||
#pragma once
|
||||
|
||||
#define MAX_PWM_MOTORS 12
|
||||
#define MAX_PWM_SERVOS 8
|
||||
|
||||
#define MAX_MOTORS 12
|
||||
#define MAX_SERVOS 8
|
||||
#define MAX_PWM_OUTPUT_PORTS MAX_PWM_MOTORS // must be set to the largest of either MAX_MOTORS or MAX_SERVOS
|
||||
|
||||
#if MAX_PWM_OUTPUT_PORTS < MAX_MOTORS || MAX_PWM_OUTPUT_PORTS < MAX_SERVOS
|
||||
#error Invalid motor/servo/port configuration
|
||||
#endif
|
||||
|
||||
|
||||
#define PULSE_1MS (1000) // 1ms pulse width
|
||||
|
||||
#define MAX_INPUTS 8
|
||||
|
||||
#define PWM_TIMER_MHZ 1
|
||||
|
||||
typedef struct drv_pwm_config_t {
|
||||
bool useParallelPWM;
|
||||
bool usePPM;
|
||||
bool useRSSIADC;
|
||||
#ifdef STM32F10X_MD
|
||||
bool useUART2;
|
||||
#endif
|
||||
bool useSoftSerial;
|
||||
bool useServos;
|
||||
bool extraServos; // configure additional 4 channels in PPM mode as servos, not motors
|
||||
bool airplane; // fixed wing hardware config, lots of servos etc
|
||||
uint16_t motorPwmRate;
|
||||
uint16_t servoPwmRate;
|
||||
uint16_t idlePulse; // PWM value to use when initializing the driver. set this to either PULSE_1MS (regular pwm),
|
||||
// some higher value (used by 3d mode), or 0, for brushed pwm drivers.
|
||||
uint16_t servoCenterPulse;
|
||||
} drv_pwm_config_t;
|
||||
|
||||
// This indexes into the read-only hardware definition structure, timerHardware_t, as well as into pwmPorts structure with dynamic data.
|
||||
enum {
|
||||
PWM1 = 0,
|
||||
PWM2,
|
||||
PWM3,
|
||||
PWM4,
|
||||
PWM5,
|
||||
PWM6,
|
||||
PWM7,
|
||||
PWM8,
|
||||
PWM9,
|
||||
PWM10,
|
||||
PWM11,
|
||||
PWM12,
|
||||
PWM13,
|
||||
PWM14
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue