mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 01:05:21 +03:00
Drop more frames
This commit is contained in:
parent
1b06f89d10
commit
8c22c97a85
3 changed files with 0 additions and 77 deletions
|
@ -398,14 +398,6 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
sbufWriteData(dst, shortGitRevision, GIT_SHORT_REVISION_LENGTH);
|
sbufWriteData(dst, shortGitRevision, GIT_SHORT_REVISION_LENGTH);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// DEPRECATED - Use MSP_API_VERSION
|
|
||||||
case MSP_IDENT:
|
|
||||||
sbufWriteU8(dst, MW_VERSION);
|
|
||||||
sbufWriteU8(dst, 3); //We no longer have mixerMode, just sent 3 (QuadX) as fallback
|
|
||||||
sbufWriteU8(dst, MSP_PROTOCOL_VERSION);
|
|
||||||
sbufWriteU32(dst, CAP_PLATFORM_32BIT | CAP_DYNBALANCE | CAP_FLAPS | CAP_NAVCAP | CAP_EXTAUX); // "capability"
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef HIL
|
#ifdef HIL
|
||||||
case MSP_HIL_STATE:
|
case MSP_HIL_STATE:
|
||||||
sbufWriteU16(dst, hilToSIM.pidCommand[ROLL]);
|
sbufWriteU16(dst, hilToSIM.pidCommand[ROLL]);
|
||||||
|
@ -731,10 +723,6 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_PID_CONTROLLER:
|
|
||||||
sbufWriteU8(dst, 2); // FIXME: Report as LuxFloat
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MSP_MODE_RANGES:
|
case MSP_MODE_RANGES:
|
||||||
for (int i = 0; i < MAX_MODE_ACTIVATION_CONDITION_COUNT; i++) {
|
for (int i = 0; i < MAX_MODE_ACTIVATION_CONDITION_COUNT; i++) {
|
||||||
const modeActivationCondition_t *mac = modeActivationConditions(i);
|
const modeActivationCondition_t *mac = modeActivationConditions(i);
|
||||||
|
@ -1672,10 +1660,6 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_SET_PID_CONTROLLER:
|
|
||||||
// FIXME: Do nothing
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MSP_SET_PID:
|
case MSP_SET_PID:
|
||||||
if (dataSize >= PID_ITEM_COUNT * 3) {
|
if (dataSize >= PID_ITEM_COUNT * 3) {
|
||||||
for (int i = 0; i < PID_ITEM_COUNT; i++) {
|
for (int i = 0; i < PID_ITEM_COUNT; i++) {
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
* if the API doesn't match EXACTLY.
|
* if the API doesn't match EXACTLY.
|
||||||
*
|
*
|
||||||
* Consumers of the API (API clients) SHOULD first attempt to get a response from the MSP_API_VERSION command.
|
* Consumers of the API (API clients) SHOULD first attempt to get a response from the MSP_API_VERSION command.
|
||||||
* If no response is obtained then client MAY try the legacy MSP_IDENT command.
|
|
||||||
*
|
*
|
||||||
* API consumers should ALWAYS handle communication failures gracefully and attempt to continue
|
* API consumers should ALWAYS handle communication failures gracefully and attempt to continue
|
||||||
* without the information if possible. Clients MAY log/display a suitable message.
|
* without the information if possible. Clients MAY log/display a suitable message.
|
||||||
|
@ -164,9 +163,6 @@
|
||||||
|
|
||||||
#define MSP_SONAR_ALTITUDE 58 //out message get surface altitude [cm]
|
#define MSP_SONAR_ALTITUDE 58 //out message get surface altitude [cm]
|
||||||
|
|
||||||
#define MSP_PID_CONTROLLER 59
|
|
||||||
#define MSP_SET_PID_CONTROLLER 60
|
|
||||||
|
|
||||||
#define MSP_ARMING_CONFIG 61 //out message Returns auto_disarm_delay and disarm_kill_switch parameters
|
#define MSP_ARMING_CONFIG 61 //out message Returns auto_disarm_delay and disarm_kill_switch parameters
|
||||||
#define MSP_SET_ARMING_CONFIG 62 //in message Sets auto_disarm_delay and disarm_kill_switch parameters
|
#define MSP_SET_ARMING_CONFIG 62 //in message Sets auto_disarm_delay and disarm_kill_switch parameters
|
||||||
|
|
||||||
|
@ -188,10 +184,6 @@
|
||||||
#define MSP_FAILSAFE_CONFIG 75 //out message Returns FC Fail-Safe settings
|
#define MSP_FAILSAFE_CONFIG 75 //out message Returns FC Fail-Safe settings
|
||||||
#define MSP_SET_FAILSAFE_CONFIG 76 //in message Sets FC Fail-Safe settings
|
#define MSP_SET_FAILSAFE_CONFIG 76 //in message Sets FC Fail-Safe settings
|
||||||
|
|
||||||
// DEPRECATED
|
|
||||||
//#define MSP_RXFAIL_CONFIG 77 //out message Returns RXFAIL settings
|
|
||||||
//#define MSP_SET_RXFAIL_CONFIG 78 //in message Sets RXFAIL settings
|
|
||||||
|
|
||||||
#define MSP_SDCARD_SUMMARY 79 //out message Get the state of the SD card
|
#define MSP_SDCARD_SUMMARY 79 //out message Get the state of the SD card
|
||||||
|
|
||||||
#define MSP_BLACKBOX_CONFIG 80 //out message Get blackbox settings
|
#define MSP_BLACKBOX_CONFIG 80 //out message Get blackbox settings
|
||||||
|
@ -240,10 +232,6 @@
|
||||||
// Multwii original MSP commands
|
// Multwii original MSP commands
|
||||||
//
|
//
|
||||||
|
|
||||||
// DEPRECATED - See MSP_API_VERSION and MSP_MIXER
|
|
||||||
#define MSP_IDENT 100 //out message mixerMode + multiwii version + protocol version + capability variable
|
|
||||||
|
|
||||||
|
|
||||||
#define MSP_STATUS 101 //out message cycletime & errors_count & sensor present & box activation & current setting number
|
#define MSP_STATUS 101 //out message cycletime & errors_count & sensor present & box activation & current setting number
|
||||||
#define MSP_RAW_IMU 102 //out message 9 DOF
|
#define MSP_RAW_IMU 102 //out message 9 DOF
|
||||||
#define MSP_SERVO 103 //out message servos
|
#define MSP_SERVO 103 //out message servos
|
||||||
|
|
|
@ -229,55 +229,6 @@ TEST_F(SerialMspUnitTest, TestMspProcessReceivedCommand)
|
||||||
checksum = FLIGHT_CONTROLLER_VERSION_LENGTH ^ MSP_FC_VERSION;
|
checksum = FLIGHT_CONTROLLER_VERSION_LENGTH ^ MSP_FC_VERSION;
|
||||||
checksum ^= FC_VERSION_MAJOR ^ FC_VERSION_MINOR ^ FC_VERSION_PATCH_LEVEL;
|
checksum ^= FC_VERSION_MAJOR ^ FC_VERSION_MINOR ^ FC_VERSION_PATCH_LEVEL;
|
||||||
EXPECT_EQ(checksum, serialBuffer.mspResponse.payload[3]);
|
EXPECT_EQ(checksum, serialBuffer.mspResponse.payload[3]);
|
||||||
|
|
||||||
// check the MSP_PID_CONTROLLER is written out correctly
|
|
||||||
serialWritePos = 0;
|
|
||||||
serialReadPos = 0;
|
|
||||||
currentProfile = &profile;
|
|
||||||
currentProfile->pidProfile.pidController = PID_CONTROLLER_MWREWRITE;
|
|
||||||
currentPort->cmdMSP = MSP_PID_CONTROLLER;
|
|
||||||
mspProcessReceivedCommand();
|
|
||||||
EXPECT_EQ('$', serialBuffer.mspResponse.header.dollar);
|
|
||||||
EXPECT_EQ('M', serialBuffer.mspResponse.header.m);
|
|
||||||
EXPECT_EQ('>', serialBuffer.mspResponse.header.direction);
|
|
||||||
EXPECT_EQ(1, serialBuffer.mspResponse.header.size);
|
|
||||||
EXPECT_EQ(MSP_PID_CONTROLLER, serialBuffer.mspResponse.header.type);
|
|
||||||
EXPECT_EQ(PID_CONTROLLER_MWREWRITE, serialBuffer.mspResponse.payload[0]);
|
|
||||||
checksum = 1 ^ MSP_PID_CONTROLLER ^ PID_CONTROLLER_MWREWRITE;
|
|
||||||
EXPECT_EQ(checksum, serialBuffer.mspResponse.payload[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(SerialMspUnitTest, Test_PID_CONTROLLER)
|
|
||||||
{
|
|
||||||
// Use the MSP to write out the PID values
|
|
||||||
currentProfile = &profile;
|
|
||||||
currentProfile->pidProfile.pidController = PID_CONTROLLER_MWREWRITE;
|
|
||||||
serialWritePos = 0;
|
|
||||||
serialReadPos = 0;
|
|
||||||
currentPort->cmdMSP = MSP_PID_CONTROLLER;
|
|
||||||
mspProcessReceivedCommand();
|
|
||||||
EXPECT_EQ(PID_CONTROLLER_MWREWRITE, serialBuffer.mspResponse.payload[0]);
|
|
||||||
|
|
||||||
// set the pidController to a different value so we can check if it gets read back properly
|
|
||||||
currentProfile->pidProfile.pidController = PID_CONTROLLER_LUX_FLOAT;
|
|
||||||
|
|
||||||
// Now use the MSP to read back the picController and check if it is the same
|
|
||||||
// spoof a change from the written MSP_PID_CONTROLLER to the readable MSP_SET_PID_CONTROLLER
|
|
||||||
currentPort->cmdMSP = MSP_SET_PID_CONTROLLER;
|
|
||||||
serialBuffer.mspResponse.header.direction = '<';
|
|
||||||
serialBuffer.mspResponse.header.type = currentPort->cmdMSP;
|
|
||||||
// force the checksum
|
|
||||||
serialBuffer.mspResponse.payload[1] ^= MSP_PID_CONTROLLER;
|
|
||||||
serialBuffer.mspResponse.payload[1] ^= MSP_SET_PID_CONTROLLER;
|
|
||||||
// copy the command data into the current port inBuf so it can be processed
|
|
||||||
memcpy(currentPort->inBuf, serialBuffer.buf, MSP_PORT_INBUF_SIZE);
|
|
||||||
|
|
||||||
// set the offset into the payload
|
|
||||||
currentPort->indRX = offsetof(struct mspResonse_s, payload);
|
|
||||||
mspProcessReceivedCommand();
|
|
||||||
|
|
||||||
// check the pidController value has been read correctly
|
|
||||||
EXPECT_EQ(PID_CONTROLLER_MWREWRITE, currentProfile->pidProfile.pidController);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SerialMspUnitTest, Test_PIDValuesInt)
|
TEST_F(SerialMspUnitTest, Test_PIDValuesInt)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue