mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
AlienFlight F4 clean up
- remove magic numbers - correct telemtry serial port configuration
This commit is contained in:
parent
75110a8299
commit
0917b428ce
2 changed files with 11 additions and 4 deletions
|
@ -48,18 +48,23 @@
|
||||||
|
|
||||||
#include "hardware_revision.h"
|
#include "hardware_revision.h"
|
||||||
|
|
||||||
|
#define CURRENTOFFSET 2500 // ACS712/714-30A - 0A = 2.5V
|
||||||
|
#define CURRENTSCALE -667 // ACS712/714-30A - 66.666 mV/A inverted mode
|
||||||
|
|
||||||
|
#define BRUSHED_MOTORS_PWM_RATE 32000 // 32kHz
|
||||||
|
|
||||||
// alternative defaults settings for AlienFlight targets
|
// alternative defaults settings for AlienFlight targets
|
||||||
void targetConfiguration(master_t *config)
|
void targetConfiguration(master_t *config)
|
||||||
{
|
{
|
||||||
config->batteryConfig.currentMeterOffset = 2500;
|
config->batteryConfig.currentMeterOffset = CURRENTOFFSET;
|
||||||
config->batteryConfig.currentMeterScale = -667;
|
config->batteryConfig.currentMeterScale = CURRENTSCALE;
|
||||||
config->gyro_sync_denom = 1;
|
config->gyro_sync_denom = 1;
|
||||||
config->mag_hardware = MAG_NONE; // disabled by default
|
config->mag_hardware = MAG_NONE; // disabled by default
|
||||||
config->pid_process_denom = 1;
|
config->pid_process_denom = 1;
|
||||||
|
|
||||||
if (hardwareMotorType == MOTOR_BRUSHED) {
|
if (hardwareMotorType == MOTOR_BRUSHED) {
|
||||||
config->motorConfig.minthrottle = 1000;
|
config->motorConfig.minthrottle = 1000;
|
||||||
config->motorConfig.motorPwmRate = 32000;
|
config->motorConfig.motorPwmRate = BRUSHED_MOTORS_PWM_RATE;
|
||||||
config->motorConfig.motorPwmProtocol = PWM_TYPE_BRUSHED;
|
config->motorConfig.motorPwmProtocol = PWM_TYPE_BRUSHED;
|
||||||
config->motorConfig.useUnsyncedPwm = true;
|
config->motorConfig.useUnsyncedPwm = true;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +76,7 @@ void targetConfiguration(master_t *config)
|
||||||
} else {
|
} else {
|
||||||
config->rxConfig.serialrx_provider = SERIALRX_SBUS;
|
config->rxConfig.serialrx_provider = SERIALRX_SBUS;
|
||||||
config->rxConfig.sbus_inversion = 0;
|
config->rxConfig.sbus_inversion = 0;
|
||||||
config->serialConfig.portConfigs[SERIAL_PORT_USART2].functionMask = FUNCTION_TELEMETRY_FRSKY;
|
config->serialConfig.portConfigs[findSerialPortIndexByIdentifier(TELEMETRY_UART)].functionMask = FUNCTION_TELEMETRY_FRSKY;
|
||||||
config->telemetryConfig.telemetry_inversion = 0;
|
config->telemetryConfig.telemetry_inversion = 0;
|
||||||
intFeatureSet(FEATURE_CURRENT_METER | FEATURE_VBAT, &config->enabledFeatures);
|
intFeatureSet(FEATURE_CURRENT_METER | FEATURE_VBAT, &config->enabledFeatures);
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,6 +168,8 @@
|
||||||
#define SERIALRX_UART SERIAL_PORT_USART2
|
#define SERIALRX_UART SERIAL_PORT_USART2
|
||||||
#define RX_CHANNELS_TAER
|
#define RX_CHANNELS_TAER
|
||||||
|
|
||||||
|
#define TELEMETRY_UART SERIAL_PORT_USART1
|
||||||
|
|
||||||
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
#define TARGET_IO_PORTA 0xffff
|
#define TARGET_IO_PORTA 0xffff
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue