diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-27 13:40:49 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-27 13:40:49 +0000 |
commit | 0a69d7dd419e1d0925c02a7b621e72e44d8c25bb (patch) | |
tree | 8b70dfe8c2061186f1511f9a940f9260a18e0b2f | |
parent | 72fee26a32402aea500c0a925021694f0bb18776 (diff) | |
download | ChibiOS-0a69d7dd419e1d0925c02a7b621e72e44d8c25bb.tar.gz ChibiOS-0a69d7dd419e1d0925c02a7b621e72e44d8c25bb.tar.bz2 ChibiOS-0a69d7dd419e1d0925c02a7b621e72e44d8c25bb.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5508 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c | 8 | ||||
-rw-r--r-- | testhal/SPC563Mxx/SPI/Makefile | 2 | ||||
-rw-r--r-- | testhal/SPC563Mxx/SPI/main.c | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c index c58fe3cb3..52b52acac 100644 --- a/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c +++ b/os/hal/platforms/SPC5xx/DSPI_v1/spi_lld.c @@ -399,16 +399,16 @@ void spi_lld_init(void) { /* Enforcing low power mode for all DSPIs even if not used.*/
#if SPC5_HAS_DSPI0
- SPC5_DSPI0.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS;
+ SPC5_DSPI0.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS | SPC5_MCR_HALT;
#endif
#if SPC5_HAS_DSPI1
- SPC5_DSPI1.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS;
+ SPC5_DSPI1.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS | SPC5_MCR_HALT;
#endif
#if SPC5_HAS_DSPI2
- SPC5_DSPI2.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS;
+ SPC5_DSPI2.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS | SPC5_MCR_HALT;
#endif
#if SPC5_HAS_DSPI3
- SPC5_DSPI3.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS;
+ SPC5_DSPI3.MCR.R = SPC5_MCR_MSTR | SPC5_MCR_MDIS | SPC5_MCR_HALT;
#endif
#if SPC5_SPI_USE_DSPI0
diff --git a/testhal/SPC563Mxx/SPI/Makefile b/testhal/SPC563Mxx/SPI/Makefile index 2cef7b38c..c52b0f44a 100644 --- a/testhal/SPC563Mxx/SPI/Makefile +++ b/testhal/SPC563Mxx/SPI/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
diff --git a/testhal/SPC563Mxx/SPI/main.c b/testhal/SPC563Mxx/SPI/main.c index 9ddb9761a..23ccd435a 100644 --- a/testhal/SPC563Mxx/SPI/main.c +++ b/testhal/SPC563Mxx/SPI/main.c @@ -119,6 +119,10 @@ int main(void) { for (i = 0; i < sizeof(txbuf); i++)
txbuf[i] = (uint8_t)i;
+ spiStart(&SPID2, &hs_spicfg); /* Setup transfer parameters. */
+ spiExchange(&SPID2, 512,
+ txbuf, rxbuf); /* Atomic transfer operations. */
+
/*
* Starting the transmitter and receiver threads.
*/
|