feat: Flysky gimbal support for RM Boxer (#3139)

* Adds Flysky digital hall gimbal support for RadioMaster Boxer.

---------

Co-authored-by: rotorman <risto.koiva@web.de>
This commit is contained in:
richardclli
2023-02-26 13:27:37 +01:00
committed by GitHub
co-authored by rotorman
parent 4ea77ee749
commit 9216570d6c
14 changed files with 125 additions and 42 deletions
+14 -2
View File
@@ -22,12 +22,16 @@
#include "opentx.h"
#include "../../hal/adc_driver.h"
#if defined(FLYSKY_GIMBAL)
#include "flysky_gimbal_driver.h"
#endif
#define HOLDANAVALUEFRAMES 4 /* 4* 50ms = 200 ms update rate */
void menuRadioDiagAnalogs(event_t event)
{
static int8_t entryCount = 0;
static uint16_t lastShownAnalogValue[NUM_STICKS+NUM_POTS+NUM_SLIDERS];
static int16_t lastShownAnalogValue[NUM_STICKS+NUM_POTS+NUM_SLIDERS];
enum ANAVIEWS{
ANAVIEW_FIRST,
@@ -106,7 +110,15 @@ void menuRadioDiagAnalogs(event_t event)
switch (viewpage) {
case (ANAVIEW_RAWLOWFPS):
if (entryCount == 0) {
lastShownAnalogValue[i] = getAnalogValue(i); // Update value
#if defined(FLYSKY_GIMBAL)
if (globalData.flyskygimbals && i < FIRST_ANALOG_ADC_FS)
{
lastShownAnalogValue[i] = hall_raw_values[i];
} else
#endif
{
lastShownAnalogValue[i] = getAnalogValue(i); // Update value
}
}
lcdDrawNumber(x+3*FW-1, y, lastShownAnalogValue[i],
LEADING0|LEFT, 4);