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

View file

@ -194,6 +194,9 @@ static const char * const boardIdentifier = TARGET_BOARD_IDENTIFIER;
#define MSP_ADVANCED_TUNING 94 #define MSP_ADVANCED_TUNING 94
#define MSP_SET_ADVANCED_TUNING 95 #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_TEMPORARY_COMMANDS 98 // Temporary Commands before cleanup
#define MSP_SET_TEMPORARY_COMMANDS 99 // Temporary Commands before cleanup #define MSP_SET_TEMPORARY_COMMANDS 99 // Temporary Commands before cleanup

View file

@ -17,7 +17,7 @@
#define FC_VERSION_MAJOR 2 // increment when a major release is made (big new feature, etc) #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_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_HELPER(x) #x
#define STR(x) STR_HELPER(x) #define STR(x) STR_HELPER(x)