Mercurial > templog
comparison main.c @ 62:68c1e2b26bc5
merge
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 26 Jun 2012 21:21:09 +0800 |
parents | 2ebe33714989 62112fc2af21 |
children | ca08442635ca |
comparison
equal
deleted
inserted
replaced
60:2ebe33714989 | 62:68c1e2b26bc5 |
---|---|
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 |