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

This commit is contained in:
gdisirio 2012-05-21 18:17:11 +00:00
parent af4378db4c
commit 8e0b313cc4
1 changed files with 3 additions and 7 deletions

View File

@ -22,7 +22,6 @@
#include "hal.h" #include "hal.h"
#include "test.h" #include "test.h"
#if 0
/* /*
* Conversion table from hex digit to 7 segments encoding, bit 5 controls the * Conversion table from hex digit to 7 segments encoding, bit 5 controls the
* dot. * dot.
@ -40,12 +39,11 @@ static uint8_t digits[32] = {
*/ */
static SPIConfig spicfg = { static SPIConfig spicfg = {
NULL, NULL,
GPIO1, GPIO0,
GPIO1_SPI0SEL, GPIO0_SPI0SEL,
CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(0), CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(0),
48 48
}; };
#endif
/* /*
* Red LED blinker thread, times are in milliseconds. * Red LED blinker thread, times are in milliseconds.
@ -114,7 +112,7 @@ int main(void) {
* Activates the SD1 and SPI1 drivers. * Activates the SD1 and SPI1 drivers.
*/ */
sdStart(&SD1, NULL); /* Default: 38400,8,N,1. */ sdStart(&SD1, NULL); /* Default: 38400,8,N,1. */
// spiStart(&SPID1, &spicfg); spiStart(&SPID1, &spicfg);
/* /*
* Creates the blinker threads. * Creates the blinker threads.
@ -130,7 +128,6 @@ int main(void) {
while (TRUE) { while (TRUE) {
if (!palReadPad(GPIO0, GPIO0_SW3)) if (!palReadPad(GPIO0, GPIO0_SW3))
TestThread(&SD1); TestThread(&SD1);
#if 0
spiSelect(&SPID1); spiSelect(&SPID1);
spiSend(&SPID1, 1, &digits[i]); /* Non polled method. */ spiSend(&SPID1, 1, &digits[i]); /* Non polled method. */
spiUnselect(&SPID1); spiUnselect(&SPID1);
@ -139,7 +136,6 @@ int main(void) {
spiPolledExchange(&SPID1, digits[i | 0x10]); /* Polled method. */ spiPolledExchange(&SPID1, digits[i | 0x10]); /* Polled method. */
spiUnselect(&SPID1); spiUnselect(&SPID1);
chThdSleepMilliseconds(500); chThdSleepMilliseconds(500);
#endif
i = (i + 1) & 15; i = (i + 1) & 15;
} }
} }