fix case where ANALOG_MASK is zero
This commit is contained in:
parent
6427e8a6cf
commit
c9f9464a26
9
analog.c
9
analog.c
|
|
@ -9,10 +9,7 @@
|
||||||
|
|
||||||
uint8_t adc_running_mask, adc_counter;
|
uint8_t adc_running_mask, adc_counter;
|
||||||
|
|
||||||
#if ANALOG_MASK & 1
|
#if ANALOG_MASK & 2
|
||||||
#define ANALOG_START 0
|
|
||||||
#define ANALOG_START_MASK 1
|
|
||||||
#elif ANALOG_MASK & 2
|
|
||||||
#define ANALOG_START 1
|
#define ANALOG_START 1
|
||||||
#define ANALOG_START_MASK 2
|
#define ANALOG_START_MASK 2
|
||||||
#elif ANALOG_MASK & 4
|
#elif ANALOG_MASK & 4
|
||||||
|
|
@ -33,6 +30,10 @@ uint8_t adc_running_mask, adc_counter;
|
||||||
#elif ANALOG_MASK & 128
|
#elif ANALOG_MASK & 128
|
||||||
#define ANALOG_START 7
|
#define ANALOG_START 7
|
||||||
#define ANALOG_START_MASK 128
|
#define ANALOG_START_MASK 128
|
||||||
|
#else
|
||||||
|
// ANALOG_MASK == 1 or 0, either way defines are the same except they're not used if ANALOG_MASK == 0
|
||||||
|
#define ANALOG_START 0
|
||||||
|
#define ANALOG_START_MASK 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
volatile uint16_t adc_result[8] __attribute__ ((__section__ (".bss")));
|
volatile uint16_t adc_result[8] __attribute__ ((__section__ (".bss")));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue