Problems with S3 on Taranis (not plus)

This commit is contained in:
bsongis
2014-08-04 10:19:31 +02:00
parent c5aed5f79b
commit 39edaff669
3 changed files with 22 additions and 3 deletions
+9 -2
View File
@@ -61,10 +61,12 @@
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};
#elif defined(REV4a)
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,-1,0,-1,1, 1};
#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
void adcInit()
@@ -129,6 +131,11 @@ void adcRead()
if (ana_direction[i] < 0) {
Analog_values[i] = 4096-Analog_values[i];
}
#if !defined(REVPLUS)
else if (ana_direction[i] == 0) {
Analog_values[i] = 0;
}
#endif
}
#endif
}