Use 32-bit int always.

This commit is contained in:
rotorman
2021-09-21 08:11:26 +02:00
committed by Risto
parent 9570f8595a
commit 89965ed5b2
2 changed files with 1 additions and 15 deletions
+1 -11
View File
@@ -1020,11 +1020,7 @@ void checkTrims()
}
#if !defined(SIMU)
#if defined(FLYSKY_HALL_STICKS)
uint32_t s_anaFilt[NUM_ANALOGS];
#else
uint16_t s_anaFilt[NUM_ANALOGS];
#endif
#endif
#if defined(JITTER_MEASURE)
@@ -1068,8 +1064,8 @@ void getADC()
DEBUG_TIMER_STOP(debugTimerAdcRead);
for (uint8_t x=0; x<NUM_ANALOGS; x++) {
#if defined(FLYSKY_HALL_STICKS)
uint32_t v;
#if defined(FLYSKY_HALL_STICKS)
if (x < 4) {
v = get_flysky_hall_adc_value(x) >> (1 - ANALOG_SCALE);
} else {
@@ -1088,7 +1084,6 @@ void getADC()
#endif
}
#else
uint16_t v;
v = getAnalogValue(x) >> (1 - ANALOG_SCALE);
#endif
@@ -1126,13 +1121,8 @@ void getADC()
// Variables mapping:
// * <in> = v
// * <out> = s_anaFilt[x]
#if defined(FLYSKY_HALL_STICKS)
uint32_t previous = s_anaFilt[x] / JITTER_ALPHA;
uint32_t diff = (v > previous) ? (v - previous) : (previous - v);
#else
uint16_t previous = s_anaFilt[x] / JITTER_ALPHA;
uint16_t diff = (v > previous) ? (v - previous) : (previous - v);
#endif
if (!g_eeGeneral.jitterFilter && diff < (10*ANALOG_MULTIPLIER)) { // g_eeGeneral.jitterFilter is inverted, 0 - active
// apply jitter filter
s_anaFilt[x] = (s_anaFilt[x] - previous) + v;
-4
View File
@@ -1280,11 +1280,7 @@ extern Clipboard clipboard;
#endif
#if !defined(SIMU)
#if defined(FLYSKY_HALL_STICKS)
extern uint32_t s_anaFilt[NUM_ANALOGS];
#else
extern uint16_t s_anaFilt[NUM_ANALOGS];
#endif
#endif
#if defined(JITTER_MEASURE)