analog-avr.c: no need to re-initialise adc_counter.

After firmware startup it's always in a valid range, even in the
unlikely case analog_init() is called twice.

This saves 4 bytes binary size without drawback.
This commit is contained in:
Markus Hitter 2016-06-23 20:30:11 +02:00
parent b52a1217a9
commit 29cb2e801a
1 changed files with 1 additions and 3 deletions

View File

@ -9,7 +9,7 @@
#include "memory_barrier.h" #include "memory_barrier.h"
static uint8_t adc_counter; static uint8_t adc_counter = 0;
static volatile uint16_t BSS adc_result[NUM_TEMP_SENSORS]; static volatile uint16_t BSS adc_result[NUM_TEMP_SENSORS];
//! Configure all registers, start interrupt loop //! Configure all registers, start interrupt loop
@ -32,8 +32,6 @@ void analog_init() {
ADCSRB = 0; ADCSRB = 0;
#endif #endif
adc_counter = 0;
// clear analog inputs in the data direction register(s) // clear analog inputs in the data direction register(s)
AIO0_DDR &= ~analog_mask; AIO0_DDR &= ~analog_mask;
#ifdef AIO8_DDR #ifdef AIO8_DDR