VC++ compilation fix

This commit is contained in:
Bertrand Songis
2016-01-31 11:34:07 +01:00
parent 979a86f24e
commit 40ae1879e8
9 changed files with 52 additions and 51 deletions
+3 -3
View File
@@ -1544,9 +1544,9 @@ void getADC()
} }
#endif #endif
for (uint32_t i=0; i<4; i++) { for (uint8_t i=0; i<4; i++) {
adcRead(); adcRead();
for (uint32_t x=0; x<NUMBER_ANALOG; x++) { for (uint8_t x=0; x<NUMBER_ANALOG; x++) {
uint16_t val = getAnalogValue(x); uint16_t val = getAnalogValue(x);
#if defined(JITTER_MEASURE) #if defined(JITTER_MEASURE)
if (JITTER_MEASURE_ACTIVE()) { if (JITTER_MEASURE_ACTIVE()) {
@@ -1557,7 +1557,7 @@ void getADC()
} }
} }
for (uint32_t x=0; x<NUMBER_ANALOG; x++) { for (uint8_t x=0; x<NUMBER_ANALOG; x++) {
uint16_t v = temp[x] >> 3; uint16_t v = temp[x] >> 3;
#if defined(JITTER_FILTER) #if defined(JITTER_FILTER)
+1 -1
View File
@@ -973,7 +973,7 @@ void checkAlarm();
void checkAll(); void checkAll();
#if !defined(SIMU) #if !defined(SIMU)
void getADC(); void getADC();
#endif #endif
#if defined(SBUS) #if defined(SBUS)
+2 -1
View File
@@ -762,8 +762,9 @@ void checkSwitches()
#define GETADC_COUNT 1 #define GETADC_COUNT 1
#endif #endif
#ifdef GETADC_COUNT #ifdef GETADC_COUNT
for (int i=0; i<GETADC_COUNT; i++) for (uinr8_t i=0; i<GETADC_COUNT; i++) {
getADC(); getADC();
}
#undef GETADC_COUNT #undef GETADC_COUNT
#endif #endif
#endif // !defined(MODULE_ALWAYS_SEND_PULSES) #endif // !defined(MODULE_ALWAYS_SEND_PULSES)
+1 -1
View File
@@ -201,7 +201,7 @@ void adcRead()
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, -1,-1, -1,1, 0,0,0}; const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, -1,-1, -1,1, 0,0,0};
uint16_t getAnalogValue(uint32_t index) uint16_t getAnalogValue(uint8_t index)
{ {
if (ana_direction[index] < 0) if (ana_direction[index] < 0)
return 4096 - adcValues[index]; return 4096 - adcValues[index];
+1 -1
View File
@@ -233,7 +233,7 @@ enum Analogs {
extern uint16_t adcValues[NUMBER_ANALOG]; extern uint16_t adcValues[NUMBER_ANALOG];
void adcInit(void); void adcInit(void);
void adcRead(void); void adcRead(void);
uint16_t getAnalogValue(uint32_t value); uint16_t getAnalogValue(uint8_t index);
#if defined(REV3) #if defined(REV3)
#define BATT_SCALE 120 #define BATT_SCALE 120
+1 -1
View File
@@ -112,7 +112,7 @@ void adcRead()
#endif #endif
} }
uint16_t getAnalogValue(uint32_t value) uint16_t getAnalogValue(uint8_t value)
{ {
return adcValues[value]; return adcValues[value];
} }
+1 -1
View File
@@ -227,7 +227,7 @@ enum Analogs {
}; };
void adcInit(); void adcInit();
void adcRead(void); void adcRead(void);
uint16_t getAnalogValue(uint32_t value); uint16_t getAnalogValue(uint8_t index);
void setSticksGain(uint8_t gains); void setSticksGain(uint8_t gains);
// Buzzer driver // Buzzer driver
+1 -1
View File
@@ -148,7 +148,7 @@ void adcStop()
{ {
} }
uint16_t getAnalogValue(uint32_t index) uint16_t getAnalogValue(uint8_t index)
{ {
if (IS_POT(index) && !IS_POT_AVAILABLE(index)) { if (IS_POT(index) && !IS_POT_AVAILABLE(index)) {
// Use fixed analog value for non-existing and/or non-connected pots. // Use fixed analog value for non-existing and/or non-connected pots.
+1 -1
View File
@@ -265,7 +265,7 @@ enum Analogs {
void adcInit(void); void adcInit(void);
void adcRead(void); void adcRead(void);
extern uint16_t adcValues[NUMBER_ANALOG]; extern uint16_t adcValues[NUMBER_ANALOG];
uint16_t getAnalogValue(uint32_t value); uint16_t getAnalogValue(uint8_t index);
#define BATT_SCALE 150 #define BATT_SCALE 150