1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-14 03:49:58 +03:00

Logic Conditions integration

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-07-20 20:11:50 +02:00
parent d85693cd98
commit 2e3f67f635
9 changed files with 142 additions and 35 deletions

View file

@ -41,6 +41,7 @@
#include "sensors/pitotmeter.h"
#include "flight/imu.h"
#include "flight/pid.h"
#include "drivers/io_port_expander.h"
#include "navigation/navigation.h"
#include "navigation/navigation_private.h"
@ -180,7 +181,12 @@ static int logicConditionCompute(
return operandA;
}
break;
#ifdef USE_I2C_IO_EXPANDER
case LOGIC_CONDITION_PORT_SET:
ioPortExpanderSet((uint8_t)operandA, (uint8_t)operandB);
return operandB;
break;
#endif
default:
return false;
break;
@ -456,6 +462,9 @@ void logicConditionUpdateTask(timeUs_t currentTimeUs) {
for (uint8_t i = 0; i < MAX_LOGIC_CONDITIONS; i++) {
logicConditionProcess(i);
}
#ifdef USE_I2C_IO_EXPANDER
ioPortExpanderSync();
#endif
}
void logicConditionReset(void) {