Fix SPI1 activation bug. Now SPI1 on at91sam7x is fully functional.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 23 Sep 2009 21:21:24 +0000 (21:21 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 23 Sep 2009 21:21:24 +0000 (21:21 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2971 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/arm/drv/ser_at91.c

index dfc429d36098d7a1b550bb4ca42feff9b46d1221..aacb99b6895e9625c78e812989ae2c5b5a1981c8 100644 (file)
@@ -530,10 +530,13 @@ static void spi1_init(UNUSED_ARG(struct SerialHardware *, _hw), UNUSED_ARG(struc
        /* Disable PIO on SPI pins */
        PIOA_PDR = BV(SPI1_SPCK) | BV(SPI1_MOSI) | BV(SPI1_MISO);
 
+       /* SPI1 pins are on B peripheral function! */
+       PIOA_BSR = BV(SPI1_SPCK) | BV(SPI1_MOSI) | BV(SPI1_MISO);
+
        /* Reset device */
        SPI1_CR = BV(SPI_SWRST);
 
-/*
+       /*
         * Set SPI to master mode, fixed peripheral select, chip select directly connected to a peripheral device,
         * SPI clock set to MCK, mode fault detection disabled, loopback disable, NPCS0 active, Delay between CS = 0
         */