fixed compile warnings

master
Nidan 15 years ago
parent 3a7ac07aae
commit 5bc81bb91e

@ -40,15 +40,17 @@ void mcpadc_init(uint8_t mode)
uint8_t mcpadc_has_new_data(void) uint8_t mcpadc_has_new_data(void)
{ {
/* this assumes that the first RDY bit read after the sample data indicates the old/new state of the sample we just read */ /* this assumes that the first RDY bit read after the sample data indicates the old/new state of the sample we just read */
#if ADC_ENABLE_18_BIT_MODE
if(curmode & ADC_BITS_MASK == ADC_BITS_18) if(curmode & ADC_BITS_MASK == ADC_BITS_18)
{ {
i2c_read(ADC_ADDR, 4, r); i2c_read(ADC_ADDR, 4, r);
curmode = r[4]; curmode = r[3];
} }
else else
#endif
{ {
i2c_read(ADC_ADDR, 3, r); i2c_read(ADC_ADDR, 3, r);
curmode = r[3]; curmode = r[2];
} }
if(~curmode & ADC_NEW_SAMPLE) {curmode &= ADC_READ_DATA;} if(~curmode & ADC_NEW_SAMPLE) {curmode &= ADC_READ_DATA;}
return ~curmode & ADC_READ_DATA; return ~curmode & ADC_READ_DATA;

Loading…
Cancel
Save