mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Initial commit
This commit is contained in:
parent
834a1361b0
commit
1f8c5d88ab
2 changed files with 46 additions and 12 deletions
|
@ -534,18 +534,6 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
|||
}
|
||||
break;
|
||||
#ifdef USE_PROGRAMMING_FRAMEWORK
|
||||
case MSP2_INAV_LOGIC_CONDITIONS:
|
||||
for (int i = 0; i < MAX_LOGIC_CONDITIONS; i++) {
|
||||
sbufWriteU8(dst, logicConditions(i)->enabled);
|
||||
sbufWriteU8(dst, logicConditions(i)->activatorId);
|
||||
sbufWriteU8(dst, logicConditions(i)->operation);
|
||||
sbufWriteU8(dst, logicConditions(i)->operandA.type);
|
||||
sbufWriteU32(dst, logicConditions(i)->operandA.value);
|
||||
sbufWriteU8(dst, logicConditions(i)->operandB.type);
|
||||
sbufWriteU32(dst, logicConditions(i)->operandB.value);
|
||||
sbufWriteU8(dst, logicConditions(i)->flags);
|
||||
}
|
||||
break;
|
||||
case MSP2_INAV_LOGIC_CONDITIONS_STATUS:
|
||||
for (int i = 0; i < MAX_LOGIC_CONDITIONS; i++) {
|
||||
sbufWriteU32(dst, logicConditionGetValue(i));
|
||||
|
@ -1547,6 +1535,23 @@ static mspResult_e mspFcSafeHomeOutCommand(sbuf_t *dst, sbuf_t *src)
|
|||
}
|
||||
}
|
||||
|
||||
static mspResult_e mspFcLogicConditionCommand(sbuf_t *dst, sbuf_t *src) {
|
||||
const uint8_t idx = sbufReadU8(src);
|
||||
if (idx < MAX_LOGIC_CONDITIONS) {
|
||||
sbufWriteU8(dst, logicConditions(idx)->enabled);
|
||||
sbufWriteU8(dst, logicConditions(idx)->activatorId);
|
||||
sbufWriteU8(dst, logicConditions(idx)->operation);
|
||||
sbufWriteU8(dst, logicConditions(idx)->operandA.type);
|
||||
sbufWriteU32(dst, logicConditions(idx)->operandA.value);
|
||||
sbufWriteU8(dst, logicConditions(idx)->operandB.type);
|
||||
sbufWriteU32(dst, logicConditions(idx)->operandB.value);
|
||||
sbufWriteU8(dst, logicConditions(idx)->flags);
|
||||
return MSP_RESULT_ACK;
|
||||
} else {
|
||||
return MSP_RESULT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
static void mspFcWaypointOutCommand(sbuf_t *dst, sbuf_t *src)
|
||||
{
|
||||
const uint8_t msp_wp_no = sbufReadU8(src); // get the wp number
|
||||
|
@ -3225,6 +3230,11 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
break;
|
||||
#endif
|
||||
|
||||
#ifdef USE_PROGRAMMING_FRAMEWORK
|
||||
case MSP2_INAV_LOGIC_CONDITIONS:
|
||||
*ret = mspFcLogicConditionCommand(dst, src);
|
||||
break;
|
||||
#endif
|
||||
case MSP2_INAV_SAFEHOME:
|
||||
*ret = mspFcSafeHomeOutCommand(dst, src);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue