diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-26 15:02:45 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-26 15:02:45 +0000 |
commit | 0fc403c55a7aa76ef509dffd614ba99785010d1e (patch) | |
tree | 7b25c2c913706eaf7b11b57215dd264de12f2064 /testhal/SPC563Mxx/SPI/main.c | |
parent | 4a2b2769363a3ec43a31e3c96ac303d241f3fc5d (diff) | |
download | ChibiOS-0fc403c55a7aa76ef509dffd614ba99785010d1e.tar.gz ChibiOS-0fc403c55a7aa76ef509dffd614ba99785010d1e.tar.bz2 ChibiOS-0fc403c55a7aa76ef509dffd614ba99785010d1e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5506 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/SPC563Mxx/SPI/main.c')
-rw-r--r-- | testhal/SPC563Mxx/SPI/main.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/testhal/SPC563Mxx/SPI/main.c b/testhal/SPC563Mxx/SPI/main.c index b3a5eb524..cd36b2ad1 100644 --- a/testhal/SPC563Mxx/SPI/main.c +++ b/testhal/SPC563Mxx/SPI/main.c @@ -50,14 +50,14 @@ static msg_t spi_thread_1(void *p) { (void)p;
chRegSetThreadName("SPI thread 1");
while (TRUE) {
- spiAcquireBus(&SPID1); /* Acquire ownership of the bus. */
+ spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
palSetPad(PORT11, P11_LED1); /* LED ON. */
- spiStart(&SPID1, &hs_spicfg); /* Setup transfer parameters. */
- spiSelect(&SPID1); /* Slave Select assertion. */
- spiExchange(&SPID1, 512,
+ spiStart(&SPID2, &hs_spicfg); /* Setup transfer parameters. */
+ spiSelect(&SPID2); /* Slave Select assertion. */
+ spiExchange(&SPID2, 512,
txbuf, rxbuf); /* Atomic transfer operations. */
- spiUnselect(&SPID1); /* Slave Select de-assertion. */
- spiReleaseBus(&SPID1); /* Ownership release. */
+ spiUnselect(&SPID2); /* Slave Select de-assertion. */
+ spiReleaseBus(&SPID2); /* Ownership release. */
}
return 0;
}
@@ -71,14 +71,14 @@ static msg_t spi_thread_2(void *p) { (void)p;
chRegSetThreadName("SPI thread 2");
while (TRUE) {
- spiAcquireBus(&SPID1); /* Acquire ownership of the bus. */
+ spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
palClearPad(PORT11, P11_LED1); /* LED OFF. */
- spiStart(&SPID1, &ls_spicfg); /* Setup transfer parameters. */
- spiSelect(&SPID1); /* Slave Select assertion. */
- spiExchange(&SPID1, 512,
+ spiStart(&SPID2, &ls_spicfg); /* Setup transfer parameters. */
+ spiSelect(&SPID2); /* Slave Select assertion. */
+ spiExchange(&SPID2, 512,
txbuf, rxbuf); /* Atomic transfer operations. */
- spiUnselect(&SPID1); /* Slave Select de-assertion. */
- spiReleaseBus(&SPID1); /* Ownership release. */
+ spiUnselect(&SPID2); /* Slave Select de-assertion. */
+ spiReleaseBus(&SPID2); /* Ownership release. */
}
return 0;
}
|