mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
Add Sensor Config MSP commands
This commit is contained in:
parent
f2460219b8
commit
6f28ba0f56
3 changed files with 15 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -194,6 +194,9 @@ static const char * const boardIdentifier = TARGET_BOARD_IDENTIFIER;
|
|||
#define MSP_ADVANCED_TUNING 94
|
||||
#define MSP_SET_ADVANCED_TUNING 95
|
||||
|
||||
#define MSP_SENSOR_CONFIG 96
|
||||
#define MSP_SET_SENSOR_CONFIG 97
|
||||
|
||||
#define MSP_TEMPORARY_COMMANDS 98 // Temporary Commands before cleanup
|
||||
#define MSP_SET_TEMPORARY_COMMANDS 99 // Temporary Commands before cleanup
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#define FC_VERSION_MAJOR 2 // increment when a major release is made (big new feature, etc)
|
||||
#define FC_VERSION_MINOR 8 // increment when a minor release is made (small new feature, change etc)
|
||||
#define FC_VERSION_PATCH_LEVEL 1 // increment when a bug is fixed
|
||||
#define FC_VERSION_PATCH_LEVEL 2 // increment when a bug is fixed
|
||||
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue