[All] FILTER mode for ADC inputs removed
This commit is contained in:
@@ -369,7 +369,7 @@ void menuGeneralSetup(uint8_t event)
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_FILTER_ADC:
|
||||
g_eeGeneral.filterInput = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_FILTERADC, STR_VFILTERADC, g_eeGeneral.filterInput, 0, 2, attr, event);
|
||||
g_eeGeneral.filterInput = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_FILTERADC, STR_VFILTERADC, g_eeGeneral.filterInput, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BEEP_LABEL:
|
||||
|
||||
+9
-50
@@ -1172,8 +1172,7 @@ void doSplash()
|
||||
lcdSetRefVolt(contrast);
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<32; i++)
|
||||
getADC_filt(); // init ADC array
|
||||
getADC_single(); // init ADC array
|
||||
|
||||
uint16_t inacSum = stickMoveValue();
|
||||
|
||||
@@ -1186,7 +1185,7 @@ void doSplash()
|
||||
CoTickDelay(1);
|
||||
#endif
|
||||
|
||||
getADC_filt();
|
||||
getADC_single();
|
||||
|
||||
uint16_t tsum = stickMoveValue();
|
||||
|
||||
@@ -1540,20 +1539,7 @@ uint16_t anaIn(uint8_t chan)
|
||||
}
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
void getADC_filt()
|
||||
{
|
||||
register uint32_t x ;
|
||||
static uint16_t t_ana[2][NUMBER_ANALOG] ;
|
||||
|
||||
read_9_adc() ;
|
||||
for( x = 0 ; x < NUMBER_ANALOG ; x += 1 )
|
||||
{
|
||||
s_anaFilt[x] = s_anaFilt[x]/2 + (t_ana[1][x] >> 2 ) ;
|
||||
t_ana[1][x] = ( t_ana[1][x] + t_ana[0][x] ) >> 1 ;
|
||||
t_ana[0][x] = ( t_ana[0][x] + Analog_values[x] ) >> 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void getADC_osmp()
|
||||
{
|
||||
register uint32_t x;
|
||||
@@ -1589,29 +1575,7 @@ void getADC_single()
|
||||
s_anaFilt[x] = Analog_values[x] >> 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void getADC_filt()
|
||||
{
|
||||
static uint16_t t_ana[2][8];
|
||||
for (uint8_t adc_input=0; adc_input<8; adc_input++) {
|
||||
ADMUX=adc_input|ADC_VREF_TYPE;
|
||||
// Start the AD conversion
|
||||
ADCSRA|=0x40;
|
||||
|
||||
// Do this while waiting
|
||||
s_anaFilt[adc_input] = (s_anaFilt[adc_input]/2 + t_ana[1][adc_input]) & 0xFFFE; //gain of 2 on last conversion - clear last bit
|
||||
t_ana[1][adc_input] = (t_ana[1][adc_input] + t_ana[0][adc_input]) >> 1;
|
||||
|
||||
// Wait for the AD conversion to complete
|
||||
while ((ADCSRA & 0x10)==0);
|
||||
ADCSRA|=0x10;
|
||||
|
||||
t_ana[0][adc_input] = (t_ana[0][adc_input] + ADC) >> 1;
|
||||
}
|
||||
}
|
||||
|
||||
void getADC_osmp()
|
||||
{
|
||||
uint16_t temp_ana;
|
||||
@@ -2580,15 +2544,10 @@ FORCEINLINE void doMixerCalculations()
|
||||
activeMixes = 0;
|
||||
#endif
|
||||
|
||||
if (g_eeGeneral.filterInput == 1) {
|
||||
getADC_filt() ;
|
||||
}
|
||||
else if ( g_eeGeneral.filterInput == 2) {
|
||||
getADC_osmp() ;
|
||||
}
|
||||
else {
|
||||
getADC_single() ;
|
||||
}
|
||||
if (g_eeGeneral.filterInput == 0)
|
||||
getADC_single();
|
||||
else
|
||||
getADC_osmp();
|
||||
|
||||
#if defined(PCBSKY9X) && defined(REVB) && !defined(SIMU)
|
||||
Current_analogue = ( Current_analogue * 31 + s_anaFilt[8] ) >> 5 ;
|
||||
@@ -3223,10 +3182,10 @@ FORCEINLINE void DSM2_USART0_vect()
|
||||
#endif
|
||||
|
||||
#if !defined(SIMU) && !defined(PCBSKY9X)
|
||||
#if defined (FRSKY) or defined(DSM2_SERIAL)
|
||||
#if defined (FRSKY) || defined(DSM2_SERIAL)
|
||||
ISR(USART0_UDRE_vect)
|
||||
{
|
||||
#if defined (FRSKY) and defined (DSM2_SERIAL)
|
||||
#if defined(FRSKY) && defined(DSM2_SERIAL)
|
||||
if (g_model.protocol == PROTO_DSM2) {
|
||||
DSM2_USART0_vect();
|
||||
}
|
||||
|
||||
@@ -896,7 +896,6 @@ void checkAll();
|
||||
#if !defined(SIMU)
|
||||
void getADC_single();
|
||||
void getADC_osmp();
|
||||
void getADC_filt();
|
||||
#endif
|
||||
|
||||
extern uint8_t s_eeDirtyMsk;
|
||||
|
||||
+2
-2
@@ -348,7 +348,7 @@ void setupPulsesPXX()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DSM2_SERIAL
|
||||
#if defined(DSM2_SERIAL)
|
||||
|
||||
// DSM2 protocol pulled from th9x - Thanks thus!!!
|
||||
|
||||
@@ -454,7 +454,7 @@ void DSM2_Init(void)
|
||||
|
||||
#endif // SIMU
|
||||
}
|
||||
#endif // ifdef DSM2_SERIAL
|
||||
#endif // defined(DSM2_SERIAL)
|
||||
|
||||
/****** END DSM2=SERIAL ********/
|
||||
|
||||
|
||||
@@ -280,7 +280,6 @@ extern uint8_t portb, portc, porth, dummyport;
|
||||
extern uint16_t dummyport16;
|
||||
extern uint8_t main_thread_running;
|
||||
|
||||
#define getADC_filt()
|
||||
#define getADC_single()
|
||||
#define getADC_osmp()
|
||||
#define getADC_bandgap()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "Ne REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SING""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SING""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\005"
|
||||
#define TR_VBLMODE "Vyp\0 ""Kl\200v.""P\200ky\0""Kl+P\200""Zap\0 "
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "AUSDGaDGb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SING""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SING""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Tast""Knpl""Alle""ON\0"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SING""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SING""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Keys""Stks""Both""ON\0"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SIMP""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SIMP""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Keys""Stks""Dos ""ON\0"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "NonREaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SIMP""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SIMP""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF\0""Btns""Stks""Tout""ON\0"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SING""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SING""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Tast""Stks""Tutt""ON\0"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SIMP""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SIMP""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "OFF ""Chav""Stks""Tudo""ON\0"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define TR_VRENAVIG "No REaREb"
|
||||
|
||||
#define LEN_VFILTERADC "\004"
|
||||
#define TR_VFILTERADC "SING""OSMP""FILT"
|
||||
#define TR_VFILTERADC "SING""OSMP"
|
||||
|
||||
#define LEN_VBLMODE "\004"
|
||||
#define TR_VBLMODE "AV ""Knpp""Spak""B\200da""P\203 "
|
||||
|
||||
Reference in New Issue
Block a user