Mercurial > ~darius > hgwebdir.cgi > avr-lib
diff ds1307.c @ 3:15d89caaf516
Add support for single UART devices, although untested apart from a compile.
Doesn't break dual UART ones :)
Also checks for PRR before setting it.
author | darius@Inchoate |
---|---|
date | Wed, 11 Mar 2009 17:28:39 +1030 |
parents | 3879f487b661 |
children | 3da232f97e81 |
line wrap: on
line diff
--- a/ds1307.c Wed Mar 11 17:10:13 2009 +1030 +++ b/ds1307.c Wed Mar 11 17:28:39 2009 +1030 @@ -46,9 +46,11 @@ */ int ds1307_init(void) { +#ifdef PRR PRR &= _BV(PRTWI); /* Power TWI on - note that the * datasheet says this is already 0 at * power on.. */ +#endif TWSR = 0; /* TWI Prescaler = 1 */ #if F_CPU < 3600000UL TWBR = 10; /* Smallest valid TWBR */