1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Add Sensor Config MSP commands

This commit is contained in:
borisbstyle 2016-06-20 23:25:49 +02:00
parent f2460219b8
commit 6f28ba0f56
3 changed files with 15 additions and 1 deletions

View file

@ -1268,6 +1268,12 @@ static bool processOutCommand(uint8_t cmdMSP)
headSerialReply(1);
serialize8(currentControlRateProfile->rcYawRate8);
break;
case MSP_SENSOR_CONFIG:
headSerialReply(3);
serialize8(masterConfig.acc_hardware);
serialize8(masterConfig.baro_hardware);
serialize8(masterConfig.mag_hardware);
break;
default:
return false;
@ -1801,6 +1807,11 @@ static bool processInCommand(void)
case MSP_SET_TEMPORARY_COMMANDS:
currentControlRateProfile->rcYawRate8 = read8();
break;
case MSP_SET_SENSOR_CONFIG:
masterConfig.acc_hardware = read8();
masterConfig.baro_hardware = read8();
masterConfig.mag_hardware = read8();
break;
default:
// we do not know how to handle the (valid) message, indicate error MSP $M!
return false;