Mercurial > templog
changeset 358:71d2cc90354a
try a few more power saving measures, untested
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 24 Jun 2012 14:18:35 +0800 |
parents | 00e213d1f067 |
children | 53b24a353e13 8fea6144951b |
files | main.c |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Sun Jun 24 10:38:07 2012 +0800 +++ b/main.c Sun Jun 24 14:18:35 2012 +0800 @@ -120,7 +120,11 @@ CLKPR = _BV(CLKPCE); // divide by 4 CLKPR = _BV(CLKPS1); - sei(); + + // enable pullups + PORTB = 0xff; // XXX change when using SPI + PORTD = 0xff; + PORTC = 0xff; // 3.3v power for bluetooth and SD DDR_LED |= _BV(PIN_LED); @@ -129,7 +133,17 @@ // set pullup PORTD |= _BV(PD2); // INT0 setup + EICRA = (1<<ISC01); // falling edge - data sheet says it won't work? EIMSK = _BV(INT0); + + // comparator disable + ACSR = _BV(ACD); + + // disable adc pin input buffers + DIDR0 = 0x3F; // acd0-adc5 + DIDR1 = (1<<AIN1D)|(1<<AIN0D); // ain0/ain1 + + sei(); } static void