1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Merge pull request #5407 from larryho5/betaflight_3_3_0_R3

- fixed TBS BST "Rates" was missing problem
This commit is contained in:
J Blackman 2018-03-09 14:56:27 +11:00 committed by GitHub
commit f00575ef76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,7 @@
#define BST_SET_FC_FILTERS 75 //in message #define BST_SET_FC_FILTERS 75 //in message
#define BST_STATUS 101 //out message cycletime & errors_count & sensor present & box activation & current setting number #define BST_STATUS 101 //out message cycletime & errors_count & sensor present & box activation & current setting number
#define BST_RC_TUNING 111 //out message rc rate, rc expo, rollpitch rate, yaw rate, dyn throttle PID #define BST_RC_TUNING 111 //out message rc rate, rc expo, rollpitch rate, yaw rate, dyn throttle PID
#define BST_SET_RC_TUNING 204 //in message rc rate, rc expo, rollpitch rate, yaw rate, dyn throttle PID, yaw expo
#define BST_PID 112 //out message P I D coeff (9 are used currently) #define BST_PID 112 //out message P I D coeff (9 are used currently)
#define BST_MISC 114 //out message powermeter trig #define BST_MISC 114 //out message powermeter trig
#define BST_SET_PID 202 //in message P I D coeff (9 are used currently) #define BST_SET_PID 202 //in message P I D coeff (9 are used currently)
@ -344,6 +345,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
bstWrite8(currentControlRateProfile->rcExpo[FD_YAW]); bstWrite8(currentControlRateProfile->rcExpo[FD_YAW]);
bstWrite8(currentControlRateProfile->rcRates[FD_YAW]); bstWrite8(currentControlRateProfile->rcRates[FD_YAW]);
break; break;
case BST_PID: case BST_PID:
for (i = 0; i < PID_ITEM_COUNT; i++) { for (i = 0; i < PID_ITEM_COUNT; i++) {
bstWrite8(currentPidProfile->pid[i].P); bstWrite8(currentPidProfile->pid[i].P);
@ -467,6 +469,29 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
currentPidProfile->pid[i].D = bstRead8(); currentPidProfile->pid[i].D = bstRead8();
} }
break; break;
case BST_SET_RC_TUNING:
if (bstReadDataSize() >= 10) {
uint8_t rate;
currentControlRateProfile->rcRates[FD_ROLL] = bstRead8();
currentControlRateProfile->rcExpo[FD_ROLL] = bstRead8();
for (i = 0; i < 3; i++) {
currentControlRateProfile->rates[i] = bstRead8();
}
rate = bstRead8();
currentControlRateProfile->dynThrPID = MIN(rate, CONTROL_RATE_CONFIG_TPA_MAX);
currentControlRateProfile->thrMid8 = bstRead8();
currentControlRateProfile->thrExpo8 = bstRead8();
currentControlRateProfile->tpa_breakpoint = bstRead16();
if (bstReadDataSize() >= 11) {
currentControlRateProfile->rcExpo[FD_YAW] = bstRead8();
}
if (bstReadDataSize() >= 12) {
currentControlRateProfile->rcRates[FD_YAW] = bstRead8();
}
} else {
ret = BST_FAILED;
}
break;
case BST_SET_MODE_RANGE: case BST_SET_MODE_RANGE:
i = bstRead8(); i = bstRead8();
if (i < MAX_MODE_ACTIVATION_CONDITION_COUNT) { if (i < MAX_MODE_ACTIVATION_CONDITION_COUNT) {