Problems with S3 on Taranis (not plus)
This commit is contained in:
@@ -1462,6 +1462,14 @@ bool isTelemetrySourceAvailable(int source)
|
|||||||
|
|
||||||
bool isInputSourceAvailable(int source)
|
bool isInputSourceAvailable(int source)
|
||||||
{
|
{
|
||||||
|
#if defined(PCBTARANIS) && !defined(REVPLUS)
|
||||||
|
if (source == MIXSRC_POT3)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
if (source>=MIXSRC_Rud && source<=MIXSRC_MAX)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -354,10 +354,14 @@ enum PotType {
|
|||||||
POT_TYPE_MAX=POT_TYPE_NO_DETENT
|
POT_TYPE_MAX=POT_TYPE_NO_DETENT
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS) && defined(REVPLUS)
|
||||||
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
|
#define IS_POT_AVAILABLE(x) ((x)!=POT3 || (g_eeGeneral.potsType & (0x03 << (2*((x)-POT1))))!=POT_TYPE_NONE)
|
||||||
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||||
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||||
|
#elif defined(PCBTARANIS)
|
||||||
|
#define IS_POT_AVAILABLE(x) ((x)!=POT3)
|
||||||
|
#define IS_POT_MULTIPOS(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_MULTIPOS)
|
||||||
|
#define IS_POT_WITHOUT_DETENT(x) ((x)>=POT1 && (x)<=POT_LAST && ((g_eeGeneral.potsType>>(2*((x)-POT1)))&0x03)==POT_TYPE_NO_DETENT)
|
||||||
#else
|
#else
|
||||||
#define IS_POT_AVAILABLE(x) (true)
|
#define IS_POT_AVAILABLE(x) (true)
|
||||||
#define IS_POT_MULTIPOS(x) (false)
|
#define IS_POT_MULTIPOS(x) (false)
|
||||||
|
|||||||
@@ -61,10 +61,12 @@
|
|||||||
|
|
||||||
volatile uint16_t Analog_values[NUMBER_ANALOG];
|
volatile uint16_t Analog_values[NUMBER_ANALOG];
|
||||||
|
|
||||||
#if defined(REV4a)
|
#if defined(REVPLUS)
|
||||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,1,-1,1, 1};
|
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,1,-1,1, 1};
|
||||||
|
#elif defined(REV4a)
|
||||||
|
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,0,-1,1, 1};
|
||||||
#elif !defined(REV3)
|
#elif !defined(REV3)
|
||||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,1,-1,1, 1};
|
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,0,-1,1, 1};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void adcInit()
|
void adcInit()
|
||||||
@@ -129,6 +131,11 @@ void adcRead()
|
|||||||
if (ana_direction[i] < 0) {
|
if (ana_direction[i] < 0) {
|
||||||
Analog_values[i] = 4096-Analog_values[i];
|
Analog_values[i] = 4096-Analog_values[i];
|
||||||
}
|
}
|
||||||
|
#if !defined(REVPLUS)
|
||||||
|
else if (ana_direction[i] == 0) {
|
||||||
|
Analog_values[i] = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user