1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-984 stabilization.c - commented out code that mirrors change to the current bank data object back to the selected bank. This is left in just in case later modules want to be able to modify the currently selected bank.

This commit is contained in:
Les Newell 2013-12-11 16:31:22 +00:00
parent 63ecf6ad73
commit 024d74c0df

View File

@ -537,7 +537,8 @@ static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
break;
default:
return; //bank number is invalid. All we can do is ignore it.
memset(&bank, 0, sizeof(StabilizationBankDataPacked));
// return; //bank number is invalid. All we can do is ignore it.
}
//Need to do this to prevent an infinite loop
@ -549,9 +550,12 @@ static void SettingsBankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
static void BankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
{
StabilizationBankData curBank, bank;
StabilizationBankData bank;
StabilizationBankGet(&bank);
//this code will be needed if any other modules alter stabilizationbank
/*
StabilizationBankData curBank;
if(flight_mode < 0) return;
switch(cast_struct_to_array(settings.FlightModeMap, settings.FlightModeMap.Stabilized1)[flight_mode])
@ -583,6 +587,8 @@ static void BankUpdatedCb(__attribute__((unused)) UAVObjEvent *ev)
default:
return; //invalid bank number
}
*/
// Set the roll rate PID constants
pid_configure(&pids[PID_RATE_ROLL], bank.RollRatePID.Kp,