git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5508 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2013-03-27 13:40:49 +00:00
parent 72fee26a32
commit 0a69d7dd41
3 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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).

View File

@ -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.
*/