Merge pull request #641 from martinbudden/bf_target_defaults
Added facility to set rx serial provider in for target.
This commit is contained in:
commit
b53070c985
|
@ -268,8 +268,13 @@ void resetSensorAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig)
|
||||||
|
|
||||||
void resetEscAndServoConfig(escAndServoConfig_t *escAndServoConfig)
|
void resetEscAndServoConfig(escAndServoConfig_t *escAndServoConfig)
|
||||||
{
|
{
|
||||||
|
#ifdef BRUSHED_MOTORS
|
||||||
|
escAndServoConfig->minthrottle = 1000;
|
||||||
|
escAndServoConfig->maxthrottle = 2000;
|
||||||
|
#else
|
||||||
escAndServoConfig->minthrottle = 1150;
|
escAndServoConfig->minthrottle = 1150;
|
||||||
escAndServoConfig->maxthrottle = 1850;
|
escAndServoConfig->maxthrottle = 1850;
|
||||||
|
#endif
|
||||||
escAndServoConfig->mincommand = 1000;
|
escAndServoConfig->mincommand = 1000;
|
||||||
escAndServoConfig->servoCenterPulse = 1500;
|
escAndServoConfig->servoCenterPulse = 1500;
|
||||||
escAndServoConfig->escDesyncProtection = 0;
|
escAndServoConfig->escDesyncProtection = 0;
|
||||||
|
@ -415,8 +420,6 @@ uint16_t getCurrentMinthrottle(void)
|
||||||
// Default settings
|
// Default settings
|
||||||
static void resetConf(void)
|
static void resetConf(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
// Clear all configuration
|
// Clear all configuration
|
||||||
memset(&masterConfig, 0, sizeof(master_t));
|
memset(&masterConfig, 0, sizeof(master_t));
|
||||||
setProfile(0);
|
setProfile(0);
|
||||||
|
@ -477,7 +480,11 @@ static void resetConf(void)
|
||||||
|
|
||||||
resetTelemetryConfig(&masterConfig.telemetryConfig);
|
resetTelemetryConfig(&masterConfig.telemetryConfig);
|
||||||
|
|
||||||
|
#ifdef SERIALRX_PROVIDER
|
||||||
|
masterConfig.rxConfig.serialrx_provider = SERIALRX_PROVIDER;
|
||||||
|
#else
|
||||||
masterConfig.rxConfig.serialrx_provider = 0;
|
masterConfig.rxConfig.serialrx_provider = 0;
|
||||||
|
#endif
|
||||||
masterConfig.rxConfig.sbus_inversion = 1;
|
masterConfig.rxConfig.sbus_inversion = 1;
|
||||||
masterConfig.rxConfig.spektrum_sat_bind = 0;
|
masterConfig.rxConfig.spektrum_sat_bind = 0;
|
||||||
masterConfig.rxConfig.spektrum_sat_bind_autoreset = 1;
|
masterConfig.rxConfig.spektrum_sat_bind_autoreset = 1;
|
||||||
|
@ -487,7 +494,7 @@ static void resetConf(void)
|
||||||
masterConfig.rxConfig.rx_min_usec = 885; // any of first 4 channels below this value will trigger rx loss detection
|
masterConfig.rxConfig.rx_min_usec = 885; // any of first 4 channels below this value will trigger rx loss detection
|
||||||
masterConfig.rxConfig.rx_max_usec = 2115; // any of first 4 channels above this value will trigger rx loss detection
|
masterConfig.rxConfig.rx_max_usec = 2115; // any of first 4 channels above this value will trigger rx loss detection
|
||||||
|
|
||||||
for (i = 0; i < MAX_SUPPORTED_RC_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < MAX_SUPPORTED_RC_CHANNEL_COUNT; i++) {
|
||||||
rxFailsafeChannelConfiguration_t *channelFailsafeConfiguration = &masterConfig.rxConfig.failsafe_channel_configurations[i];
|
rxFailsafeChannelConfiguration_t *channelFailsafeConfiguration = &masterConfig.rxConfig.failsafe_channel_configurations[i];
|
||||||
channelFailsafeConfiguration->mode = (i < NON_AUX_CHANNEL_COUNT) ? RX_FAILSAFE_MODE_AUTO : RX_FAILSAFE_MODE_HOLD;
|
channelFailsafeConfiguration->mode = (i < NON_AUX_CHANNEL_COUNT) ? RX_FAILSAFE_MODE_AUTO : RX_FAILSAFE_MODE_HOLD;
|
||||||
channelFailsafeConfiguration->step = (i == THROTTLE) ? CHANNEL_VALUE_TO_RXFAIL_STEP(masterConfig.rxConfig.rx_min_usec) : CHANNEL_VALUE_TO_RXFAIL_STEP(masterConfig.rxConfig.midrc);
|
channelFailsafeConfiguration->step = (i == THROTTLE) ? CHANNEL_VALUE_TO_RXFAIL_STEP(masterConfig.rxConfig.rx_min_usec) : CHANNEL_VALUE_TO_RXFAIL_STEP(masterConfig.rxConfig.midrc);
|
||||||
|
@ -549,8 +556,7 @@ static void resetConf(void)
|
||||||
|
|
||||||
resetPidProfile(¤tProfile->pidProfile);
|
resetPidProfile(¤tProfile->pidProfile);
|
||||||
|
|
||||||
uint8_t rI;
|
for (int rI = 0; rI<MAX_RATEPROFILES; rI++) {
|
||||||
for (rI = 0; rI<MAX_RATEPROFILES; rI++) {
|
|
||||||
resetControlRateConfig(&masterConfig.profile[0].controlRateProfile[rI]);
|
resetControlRateConfig(&masterConfig.profile[0].controlRateProfile[rI]);
|
||||||
}
|
}
|
||||||
resetRollAndPitchTrims(&masterConfig.accelerometerTrims);
|
resetRollAndPitchTrims(&masterConfig.accelerometerTrims);
|
||||||
|
@ -581,7 +587,7 @@ static void resetConf(void)
|
||||||
|
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
// servos
|
// servos
|
||||||
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
|
for (int i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
|
||||||
masterConfig.servoConf[i].min = DEFAULT_SERVO_MIN;
|
masterConfig.servoConf[i].min = DEFAULT_SERVO_MIN;
|
||||||
masterConfig.servoConf[i].max = DEFAULT_SERVO_MAX;
|
masterConfig.servoConf[i].max = DEFAULT_SERVO_MAX;
|
||||||
masterConfig.servoConf[i].middle = DEFAULT_SERVO_MIDDLE;
|
masterConfig.servoConf[i].middle = DEFAULT_SERVO_MIDDLE;
|
||||||
|
@ -600,8 +606,9 @@ static void resetConf(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// custom mixer. clear by defaults.
|
// custom mixer. clear by defaults.
|
||||||
for (i = 0; i < MAX_SUPPORTED_MOTORS; i++)
|
for (int i = 0; i < MAX_SUPPORTED_MOTORS; i++) {
|
||||||
masterConfig.customMotorMixer[i].throttle = 0.0f;
|
masterConfig.customMotorMixer[i].throttle = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef LED_STRIP
|
#ifdef LED_STRIP
|
||||||
applyDefaultColors(masterConfig.colors, CONFIGURABLE_COLOR_COUNT);
|
applyDefaultColors(masterConfig.colors, CONFIGURABLE_COLOR_COUNT);
|
||||||
|
@ -661,11 +668,8 @@ static void resetConf(void)
|
||||||
#ifdef ALIENFLIGHTF3
|
#ifdef ALIENFLIGHTF3
|
||||||
masterConfig.mag_hardware = MAG_NONE; // disabled by default
|
masterConfig.mag_hardware = MAG_NONE; // disabled by default
|
||||||
#endif
|
#endif
|
||||||
masterConfig.rxConfig.serialrx_provider = SERIALRX_SPEKTRUM2048;
|
|
||||||
masterConfig.rxConfig.spektrum_sat_bind = 5;
|
masterConfig.rxConfig.spektrum_sat_bind = 5;
|
||||||
masterConfig.rxConfig.spektrum_sat_bind_autoreset = 1;
|
masterConfig.rxConfig.spektrum_sat_bind_autoreset = 1;
|
||||||
masterConfig.escAndServoConfig.minthrottle = 1000;
|
|
||||||
masterConfig.escAndServoConfig.maxthrottle = 2000;
|
|
||||||
masterConfig.motor_pwm_rate = 32000;
|
masterConfig.motor_pwm_rate = 32000;
|
||||||
masterConfig.failsafeConfig.failsafe_delay = 2;
|
masterConfig.failsafeConfig.failsafe_delay = 2;
|
||||||
masterConfig.failsafeConfig.failsafe_off_delay = 0;
|
masterConfig.failsafeConfig.failsafe_off_delay = 0;
|
||||||
|
@ -690,7 +694,7 @@ static void resetConf(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// copy first profile into remaining profile
|
// copy first profile into remaining profile
|
||||||
for (i = 1; i < MAX_PROFILE_COUNT; i++) {
|
for (int i = 1; i < MAX_PROFILE_COUNT; i++) {
|
||||||
memcpy(&masterConfig.profile[i], currentProfile, sizeof(profile_t));
|
memcpy(&masterConfig.profile[i], currentProfile, sizeof(profile_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,7 +806,7 @@ void activateConfig(void)
|
||||||
void validateAndFixConfig(void)
|
void validateAndFixConfig(void)
|
||||||
{
|
{
|
||||||
if (!(featureConfigured(FEATURE_RX_PARALLEL_PWM) || featureConfigured(FEATURE_RX_PPM) || featureConfigured(FEATURE_RX_SERIAL) || featureConfigured(FEATURE_RX_MSP))) {
|
if (!(featureConfigured(FEATURE_RX_PARALLEL_PWM) || featureConfigured(FEATURE_RX_PPM) || featureConfigured(FEATURE_RX_SERIAL) || featureConfigured(FEATURE_RX_MSP))) {
|
||||||
featureSet(FEATURE_RX_PARALLEL_PWM); // Consider changing the default to PPM
|
featureSet(DEFAULT_RX_FEATURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (featureConfigured(FEATURE_RX_PPM)) {
|
if (featureConfigured(FEATURE_RX_PPM)) {
|
||||||
|
|
|
@ -130,8 +130,9 @@
|
||||||
#define BINDPLUG_PIN PB12
|
#define BINDPLUG_PIN PB12
|
||||||
|
|
||||||
#define BRUSHED_MOTORS
|
#define BRUSHED_MOTORS
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
|
||||||
#define DEFAULT_FEATURES FEATURE_MOTOR_STOP
|
#define DEFAULT_FEATURES FEATURE_MOTOR_STOP
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
|
||||||
|
|
||||||
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,9 @@
|
||||||
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
|
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
|
||||||
|
|
||||||
#define BRUSHED_MOTORS
|
#define BRUSHED_MOTORS
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
|
||||||
#define DEFAULT_FEATURES (FEATURE_MOTOR_STOP | FEATURE_BLACKBOX)
|
#define DEFAULT_FEATURES (FEATURE_MOTOR_STOP | FEATURE_BLACKBOX)
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
|
||||||
|
|
||||||
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
|
|
|
@ -175,8 +175,8 @@
|
||||||
#define SONAR_ECHO_PIN PB1
|
#define SONAR_ECHO_PIN PB1
|
||||||
#define SONAR_TRIGGER_PIN PB0
|
#define SONAR_TRIGGER_PIN PB0
|
||||||
|
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
|
||||||
#define DEFAULT_FEATURES FEATURE_BLACKBOX
|
#define DEFAULT_FEATURES FEATURE_BLACKBOX
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
||||||
|
|
||||||
#define SPEKTRUM_BIND
|
#define SPEKTRUM_BIND
|
||||||
// USART3,
|
// USART3,
|
||||||
|
|
|
@ -19,10 +19,7 @@
|
||||||
|
|
||||||
#define TARGET_BOARD_IDENTIFIER "FYF4" //Call it a revo for now so it connects to RFC for testing.
|
#define TARGET_BOARD_IDENTIFIER "FYF4" //Call it a revo for now so it connects to RFC for testing.
|
||||||
#define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
|
#define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
|
||||||
#define CONFIG_SERIALRX_PROVIDER SERIALRX_SBUS
|
|
||||||
#define CONFIG_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
|
#define CONFIG_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
|
||||||
#define CONFIG_FEATURE_RX_SERIAL
|
|
||||||
#define CONFIG_FEATURE_ONESHOT125
|
|
||||||
#define CONFIG_MSP_PORT 2
|
#define CONFIG_MSP_PORT 2
|
||||||
#define CONFIG_RX_SERIAL_PORT 1
|
#define CONFIG_RX_SERIAL_PORT 1
|
||||||
|
|
||||||
|
@ -148,7 +145,9 @@
|
||||||
#define RSSI_ADC_GPIO_PIN PC2
|
#define RSSI_ADC_GPIO_PIN PC2
|
||||||
#define CURRENT_METER_ADC_PIN PC3
|
#define CURRENT_METER_ADC_PIN PC3
|
||||||
|
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
#define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_BLACKBOX | FEATURE_ONESHOT125)
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SBUS
|
||||||
|
|
||||||
#define TARGET_IO_PORTA 0xffff
|
#define TARGET_IO_PORTA 0xffff
|
||||||
#define TARGET_IO_PORTB 0xffff
|
#define TARGET_IO_PORTB 0xffff
|
||||||
|
|
|
@ -79,8 +79,9 @@
|
||||||
//#define CURRENT_METER_ADC_PIN PA5
|
//#define CURRENT_METER_ADC_PIN PA5
|
||||||
//#define RSSI_ADC_PIN PB2
|
//#define RSSI_ADC_PIN PB2
|
||||||
|
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
|
||||||
#define DEFAULT_FEATURES FEATURE_VBAT
|
#define DEFAULT_FEATURES FEATURE_VBAT
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SBUS;
|
||||||
|
|
||||||
#define SPEKTRUM_BIND
|
#define SPEKTRUM_BIND
|
||||||
#define BIND_PIN PB4
|
#define BIND_PIN PB4
|
||||||
|
|
|
@ -167,22 +167,24 @@
|
||||||
|
|
||||||
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
// alternative defaults for AlienFlight F1 target
|
|
||||||
#ifdef ALIENFLIGHTF1
|
#ifdef ALIENFLIGHTF1
|
||||||
|
// alternative defaults for AlienFlight F1 target
|
||||||
#undef TARGET_BOARD_IDENTIFIER
|
#undef TARGET_BOARD_IDENTIFIER
|
||||||
#define TARGET_BOARD_IDENTIFIER "AFF1" // AlienFlight F1.
|
#define TARGET_BOARD_IDENTIFIER "AFF1" // AlienFlight F1.
|
||||||
#undef BOARD_HAS_VOLTAGE_DIVIDER
|
|
||||||
|
|
||||||
// alternative defaults for AlienFlight F1 target
|
|
||||||
#define ALIENFLIGHT
|
#define ALIENFLIGHT
|
||||||
|
|
||||||
|
#undef BOARD_HAS_VOLTAGE_DIVIDER
|
||||||
|
#undef USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
|
||||||
#define BRUSHED_MOTORS
|
#define BRUSHED_MOTORS
|
||||||
#define DEFAULT_FEATURES (FEATURE_RX_SERIAL | FEATURE_MOTOR_STOP)
|
#define DEFAULT_FEATURES FEATURE_MOTOR_STOP
|
||||||
|
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SPEKTRUM2048
|
||||||
|
|
||||||
#define HARDWARE_BIND_PLUG
|
#define HARDWARE_BIND_PLUG
|
||||||
// Hardware bind plug at PB5 (Pin 41)
|
// Hardware bind plug at PB5 (Pin 41)
|
||||||
#define BINDPLUG_PIN PB5
|
#define BINDPLUG_PIN PB5
|
||||||
#endif
|
#endif // ALIENFLIGHTF1
|
||||||
|
|
||||||
// IO - assuming all IOs on 48pin package
|
// IO - assuming all IOs on 48pin package
|
||||||
#define TARGET_IO_PORTA 0xffff
|
#define TARGET_IO_PORTA 0xffff
|
||||||
|
|
Loading…
Reference in New Issue