mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 00:35:34 +03:00
Revert "Merge pull request #9873 from iNavFlight/dzikuvx-new-msp-frames-for-servos"
This reverts commitf7bda375d2
, reversing changes made toa8de611b1a
.
This commit is contained in:
parent
225a8efe32
commit
2d20132ecb
4 changed files with 41 additions and 7 deletions
|
@ -492,16 +492,29 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
|||
case MSP_SERVO:
|
||||
sbufWriteData(dst, &servo, MAX_SUPPORTED_SERVOS * 2);
|
||||
break;
|
||||
|
||||
case MSP2_INAV_SERVO_CONFIG:
|
||||
case MSP_SERVO_CONFIGURATIONS:
|
||||
for (int i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
|
||||
sbufWriteU16(dst, servoParams(i)->min);
|
||||
sbufWriteU16(dst, servoParams(i)->max);
|
||||
sbufWriteU16(dst, servoParams(i)->middle);
|
||||
sbufWriteU8(dst, servoParams(i)->rate);
|
||||
sbufWriteU8(dst, 0);
|
||||
sbufWriteU8(dst, 0);
|
||||
sbufWriteU8(dst, 255); // used to be forwardFromChannel, not used anymore, send 0xff for compatibility reasons
|
||||
sbufWriteU32(dst, 0); //Input reversing is not required since it can be done on mixer level
|
||||
}
|
||||
break;
|
||||
case MSP_SERVO_MIX_RULES:
|
||||
for (int i = 0; i < MAX_SERVO_RULES; i++) {
|
||||
sbufWriteU8(dst, customServoMixers(i)->targetChannel);
|
||||
sbufWriteU8(dst, customServoMixers(i)->inputSource);
|
||||
sbufWriteU16(dst, customServoMixers(i)->rate);
|
||||
sbufWriteU8(dst, customServoMixers(i)->speed);
|
||||
sbufWriteU8(dst, 0);
|
||||
sbufWriteU8(dst, 100);
|
||||
sbufWriteU8(dst, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case MSP2_INAV_SERVO_MIXER:
|
||||
for (int i = 0; i < MAX_SERVO_RULES; i++) {
|
||||
sbufWriteU8(dst, customServoMixers(i)->targetChannel);
|
||||
|
@ -2065,8 +2078,8 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
return MSP_RESULT_ERROR;
|
||||
break;
|
||||
|
||||
case MSP2_INAV_SET_SERVO_CONFIG:
|
||||
if (dataSize != 8) {
|
||||
case MSP_SET_SERVO_CONFIGURATION:
|
||||
if (dataSize != (1 + 14)) {
|
||||
return MSP_RESULT_ERROR;
|
||||
}
|
||||
tmp_u8 = sbufReadU8(src);
|
||||
|
@ -2077,10 +2090,28 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
servoParamsMutable(tmp_u8)->max = sbufReadU16(src);
|
||||
servoParamsMutable(tmp_u8)->middle = sbufReadU16(src);
|
||||
servoParamsMutable(tmp_u8)->rate = sbufReadU8(src);
|
||||
sbufReadU8(src);
|
||||
sbufReadU8(src);
|
||||
sbufReadU8(src); // used to be forwardFromChannel, ignored
|
||||
sbufReadU32(src); // used to be reversedSources
|
||||
servoComputeScalingFactors(tmp_u8);
|
||||
}
|
||||
break;
|
||||
|
||||
case MSP_SET_SERVO_MIX_RULE:
|
||||
sbufReadU8Safe(&tmp_u8, src);
|
||||
if ((dataSize == 9) && (tmp_u8 < MAX_SERVO_RULES)) {
|
||||
customServoMixersMutable(tmp_u8)->targetChannel = sbufReadU8(src);
|
||||
customServoMixersMutable(tmp_u8)->inputSource = sbufReadU8(src);
|
||||
customServoMixersMutable(tmp_u8)->rate = sbufReadU16(src);
|
||||
customServoMixersMutable(tmp_u8)->speed = sbufReadU8(src);
|
||||
sbufReadU16(src); //Read 2bytes for min/max and ignore it
|
||||
sbufReadU8(src); //Read 1 byte for `box` and ignore it
|
||||
loadCustomServoMixer();
|
||||
} else
|
||||
return MSP_RESULT_ERROR;
|
||||
break;
|
||||
|
||||
case MSP2_INAV_SET_SERVO_MIXER:
|
||||
sbufReadU8Safe(&tmp_u8, src);
|
||||
if ((dataSize == 7) && (tmp_u8 < MAX_SERVO_RULES)) {
|
||||
|
|
|
@ -243,6 +243,7 @@
|
|||
#define MSP_PIDNAMES 117 //out message the PID names
|
||||
#define MSP_WP 118 //out message get a WP, WP# is in the payload, returns (WP#, lat, lon, alt, flags) WP#0-home, WP#16-poshold
|
||||
#define MSP_BOXIDS 119 //out message get the permanent IDs associated to BOXes
|
||||
#define MSP_SERVO_CONFIGURATIONS 120 //out message All servo configurations.
|
||||
#define MSP_NAV_STATUS 121 //out message Returns navigation status
|
||||
#define MSP_NAV_CONFIG 122 //out message Returns navigation parameters
|
||||
#define MSP_3D 124 //out message Settings needed for reversible ESCs
|
||||
|
@ -262,6 +263,7 @@
|
|||
#define MSP_SET_WP 209 //in message sets a given WP (WP#,lat, lon, alt, flags)
|
||||
#define MSP_SELECT_SETTING 210 //in message Select Setting Number (0-2)
|
||||
#define MSP_SET_HEAD 211 //in message define a new heading hold direction
|
||||
#define MSP_SET_SERVO_CONFIGURATION 212 //in message Servo settings
|
||||
#define MSP_SET_MOTOR 214 //in message PropBalance function
|
||||
#define MSP_SET_NAV_CONFIG 215 //in message Sets nav config parameters - write to the eeprom
|
||||
#define MSP_SET_3D 217 //in message Settings needed for reversible ESCs
|
||||
|
@ -288,6 +290,8 @@
|
|||
#define MSP_GPSSTATISTICS 166 //out message get GPS debugging data
|
||||
#define MSP_ACC_TRIM 240 //out message get acc angle trim values
|
||||
#define MSP_SET_ACC_TRIM 239 //in message set acc angle trim values
|
||||
#define MSP_SERVO_MIX_RULES 241 //out message Returns servo mixer configuration
|
||||
#define MSP_SET_SERVO_MIX_RULE 242 //in message Sets servo mixer configuration
|
||||
#define MSP_SET_PASSTHROUGH 245 //in message Sets up passthrough to different peripherals (4way interface, uart, etc...)
|
||||
#define MSP_RTC 246 //out message Gets the RTC clock (returns: secs(i32) millis(u16) - (0,0) if time is not known)
|
||||
#define MSP_SET_RTC 247 //in message Sets the RTC clock (args: secs(i32) millis(u16))
|
||||
|
|
|
@ -32,3 +32,4 @@
|
|||
// radar commands
|
||||
#define MSP2_COMMON_SET_RADAR_POS 0x100B //SET radar position information
|
||||
#define MSP2_COMMON_SET_RADAR_ITD 0x100C //SET radar information to display
|
||||
|
||||
|
|
|
@ -108,5 +108,3 @@
|
|||
#define MSP2_INAV_CUSTOM_OSD_ELEMENTS 0x2100
|
||||
#define MSP2_INAV_SET_CUSTOM_OSD_ELEMENTS 0x2101
|
||||
|
||||
#define MSP2_INAV_SERVO_CONFIG 0x2200
|
||||
#define MSP2_INAV_SET_SERVO_CONFIG 0x2201
|
Loading…
Add table
Add a link
Reference in a new issue