mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
implemented LED Pin PWM programming function
This commit is contained in:
parent
a55bea82b8
commit
6cfaa227cb
2 changed files with 14 additions and 1 deletions
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
#include "io/vtx.h"
|
#include "io/vtx.h"
|
||||||
#include "drivers/vtx_common.h"
|
#include "drivers/vtx_common.h"
|
||||||
|
#include "drivers/light_ws2811strip.h"
|
||||||
|
|
||||||
PG_REGISTER_ARRAY_WITH_RESET_FN(logicCondition_t, MAX_LOGIC_CONDITIONS, logicConditions, PG_LOGIC_CONDITIONS, 4);
|
PG_REGISTER_ARRAY_WITH_RESET_FN(logicCondition_t, MAX_LOGIC_CONDITIONS, logicConditions, PG_LOGIC_CONDITIONS, 4);
|
||||||
|
|
||||||
|
@ -473,6 +474,17 @@ static int logicConditionCompute(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef LED_PIN
|
||||||
|
case LOGIC_CONDITION_LED_PIN_PWM:
|
||||||
|
if (operandA >=0 && operandA <= 100) {
|
||||||
|
ledPinStartPWM((uint8_t)operandA);
|
||||||
|
} else {
|
||||||
|
ledPinStopPWM();
|
||||||
|
}
|
||||||
|
return operandA;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -81,7 +81,8 @@ typedef enum {
|
||||||
LOGIC_CONDITION_TIMER = 49,
|
LOGIC_CONDITION_TIMER = 49,
|
||||||
LOGIC_CONDITION_DELTA = 50,
|
LOGIC_CONDITION_DELTA = 50,
|
||||||
LOGIC_CONDITION_APPROX_EQUAL = 51,
|
LOGIC_CONDITION_APPROX_EQUAL = 51,
|
||||||
LOGIC_CONDITION_LAST = 52,
|
LOGIC_CONDITION_LED_PIN_PWM = 52,
|
||||||
|
LOGIC_CONDITION_LAST = 53,
|
||||||
} logicOperation_e;
|
} logicOperation_e;
|
||||||
|
|
||||||
typedef enum logicOperandType_s {
|
typedef enum logicOperandType_s {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue