Mercurial > templog
comparison main.c @ 368:d4c9c360448f
merge
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 26 Jun 2012 21:21:09 +0800 |
parents | daad73f65c0f 3db118498b97 |
children | ca08442635ca |
comparison
equal
deleted
inserted
replaced
366:daad73f65c0f | 368:d4c9c360448f |
---|---|
623 static uint16_t | 623 static uint16_t |
624 adc_vcc() | 624 adc_vcc() |
625 { | 625 { |
626 PRR &= ~_BV(PRADC); | 626 PRR &= ~_BV(PRADC); |
627 | 627 |
628 // left adjust | 628 // /16 prescaler |
629 ADMUX = _BV(ADLAR); | |
630 | |
631 // /128 prescaler | |
632 ADCSRA = _BV(ADEN) | _BV(ADPS2); | 629 ADCSRA = _BV(ADEN) | _BV(ADPS2); |
633 | 630 |
634 // set to measure 1.1 reference | 631 // set to measure 1.1 reference |
635 ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); | 632 ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); |
636 // average a number of samples | 633 // average a number of samples |