Streamlines and cleaned up code. Simple compile option TARANIS_STICKS=YES

This commit is contained in:
rob@marotori.com
2013-09-20 15:25:20 +00:00
parent 95a1fd273b
commit 121dad121c
2 changed files with 6 additions and 18 deletions
+4 -5
View File
@@ -38,10 +38,8 @@
volatile uint16_t Analog_values[NUMBER_ANALOG];
#if defined(STICK_RUD_REV) || defined(STICK_AIL_REV) || defined(STICK_ELE_REV) || defined(STICK_THR_REV)
const char ana_direction[NUMBER_ANALOG] = {STICK_AIL_REV, STICK_RUD_REV, 0, STICK_ELE_REV ,0 , STICK_THR_REV,0, 0, 0};
#else
const char ana_direction[NUMBER_ANALOG] = {0, 0, 0, 0 ,0 ,0 ,0 , 0, 0};
#if defined(TARANIS_STICKS)
const char ana_direction[NUMBER_ANALOG] = {1, 1, 0, 1 ,0 ,1 ,0, 0, 0};
#endif
@@ -120,11 +118,12 @@ void adcRead()
}
// adc direction correct
#if defined(TARANIS_STICKS)
uint32_t i ;
for (i=0; i<NUMBER_ANALOG; i++) {
if (ana_direction[i]) {
Analog_values[i] = 4096-Analog_values[i];
}
}
#endif
}