From 7a0bc4cb9c943ebfe4e72e3a2065d8b58d5f2e71 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 21 Jun 2012 12:03:32 -0300 Subject: [PATCH] fw/spi.c: clean up code and add option for running at fosc/2 instead of fosc/4 Not enabled yet. There's a RF comm regression elsewhere that needs fixing first. --- fw/spi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fw/spi.c b/fw/spi.c index 97f0321..0337caf 100644 --- a/fw/spi.c +++ b/fw/spi.c @@ -26,8 +26,11 @@ void spi_init(void) { - /* Enable, SPI mode 0, master, MSB first, fosc/4 */ - SPCR = (1 << SPE) | (1 << MSTR); + /* SPI mode 0, MSB first, fosc/4 */ + SPCR = + 1 << SPE | /* enable SPI */ + 1 << MSTR; /* master */ +// SPSR = 1 << SPI2X; /* enable for fosc/2 */ }