1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00

Move modes and adjustments from profile to free up flash

This commit is contained in:
KiteAnton 2016-01-25 23:34:04 +01:00
parent 27772ba56a
commit 69c7c2f9c7
9 changed files with 22 additions and 20 deletions

View file

@ -728,7 +728,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
break;
case BST_MODE_RANGES:
for (i = 0; i < MAX_MODE_ACTIVATION_CONDITION_COUNT; i++) {
modeActivationCondition_t *mac = &currentProfile->modeActivationConditions[i];
modeActivationCondition_t *mac = &masterConfig.modeActivationConditions[i];
const box_t *box = &boxes[mac->modeId];
bstWrite8(box->permanentId);
bstWrite8(mac->auxChannelIndex);
@ -738,7 +738,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
break;
case BST_ADJUSTMENT_RANGES:
for (i = 0; i < MAX_ADJUSTMENT_RANGE_COUNT; i++) {
adjustmentRange_t *adjRange = &currentProfile->adjustmentRanges[i];
adjustmentRange_t *adjRange = &masterConfig.adjustmentRanges[i];
bstWrite8(adjRange->adjustmentIndex);
bstWrite8(adjRange->auxChannelIndex);
bstWrite8(adjRange->range.startStep);
@ -1089,7 +1089,7 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
case BST_SET_MODE_RANGE:
i = bstRead8();
if (i < MAX_MODE_ACTIVATION_CONDITION_COUNT) {
modeActivationCondition_t *mac = &currentProfile->modeActivationConditions[i];
modeActivationCondition_t *mac = &masterConfig.modeActivationConditions[i];
i = bstRead8();
const box_t *box = findBoxByPermenantId(i);
if (box) {
@ -1109,7 +1109,7 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
case BST_SET_ADJUSTMENT_RANGE:
i = bstRead8();
if (i < MAX_ADJUSTMENT_RANGE_COUNT) {
adjustmentRange_t *adjRange = &currentProfile->adjustmentRanges[i];
adjustmentRange_t *adjRange = &masterConfig.adjustmentRanges[i];
i = bstRead8();
if (i < MAX_SIMULTANEOUS_ADJUSTMENT_COUNT) {
adjRange->adjustmentIndex = i;