sys/arduino: reduce scope of adc_line_state
This makes cppcheck happy.
This commit is contained in:
parent
0c98b79e2f
commit
9311e05fcf
@ -72,15 +72,14 @@ unsigned long micros()
|
||||
return xtimer_now_usec();
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitfield for the state of the ADC-channels.
|
||||
* 0: Not initialized
|
||||
* 1: Successfully initialized
|
||||
*/
|
||||
static uint16_t adc_line_state = 0;
|
||||
|
||||
int analogRead(int arduino_pin)
|
||||
{
|
||||
/*
|
||||
* Bitfield for the state of the ADC-channels.
|
||||
* 0: Not initialized
|
||||
* 1: Successfully initialized
|
||||
*/
|
||||
static uint16_t adc_line_state;
|
||||
int adc_value;
|
||||
|
||||
/* Check if the ADC line is valid */
|
||||
@ -92,7 +91,7 @@ int analogRead(int arduino_pin)
|
||||
return -1;
|
||||
}
|
||||
/* The ADC channel is initialized */
|
||||
adc_line_state |= 1 << arduino_pin;
|
||||
adc_line_state |= (1 << arduino_pin);
|
||||
}
|
||||
|
||||
/* Read the ADC channel */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user