Merge pull request #1668 from AlienWiiBF/Serial_Fix

Fix findSerialPortIndexByIdentifier() function
This commit is contained in:
borisbstyle 2016-11-26 00:20:37 +01:00 committed by GitHub
commit ebb1be31d0
3 changed files with 3 additions and 6 deletions

View File

@ -110,8 +110,7 @@ baudRate_e lookupBaudRateIndex(uint32_t baudRate)
int findSerialPortIndexByIdentifier(serialPortIdentifier_e identifier)
{
for (int index = 0; index < SERIAL_PORT_COUNT; index++) {
const serialPortUsage_t *candidate = &serialPortUsageList[index];
if (candidate->identifier == identifier) {
if (serialPortIdentifiers[index] == identifier) {
return index;
}
}

View File

@ -47,14 +47,13 @@ void targetConfiguration(master_t *config)
{
config->rxConfig.spektrum_sat_bind = 5;
config->rxConfig.spektrum_sat_bind_autoreset = 1;
config->gyro_sync_denom = 2;
config->sensorSelectionConfig.mag_hardware = MAG_NONE; // disabled by default
config->pid_process_denom = 1;
if (hardwareMotorType == MOTOR_BRUSHED) {
config->motorConfig.minthrottle = 1000;
config->motorConfig.motorPwmRate = 32000;
config->motorConfig.motorPwmProtocol = PWM_TYPE_BRUSHED;
config->pid_process_denom = 2;
config->motorConfig.useUnsyncedPwm = true;
}

View File

@ -58,14 +58,13 @@ void targetConfiguration(master_t *config)
{
config->batteryConfig.currentMeterOffset = CURRENTOFFSET;
config->batteryConfig.currentMeterScale = CURRENTSCALE;
config->gyro_sync_denom = 1;
config->sensorSelectionConfig.mag_hardware = MAG_NONE; // disabled by default
config->pid_process_denom = 1;
if (hardwareMotorType == MOTOR_BRUSHED) {
config->motorConfig.minthrottle = 1000;
config->motorConfig.motorPwmRate = BRUSHED_MOTORS_PWM_RATE;
config->motorConfig.motorPwmProtocol = PWM_TYPE_BRUSHED;
config->pid_process_denom = 1;
config->motorConfig.useUnsyncedPwm = true;
}