diff options
Diffstat (limited to 'testhal/STM32F37x/SPI')
-rw-r--r-- | testhal/STM32F37x/SPI/.project | 2 | ||||
-rw-r--r-- | testhal/STM32F37x/SPI/halconf.h | 4 | ||||
-rw-r--r-- | testhal/STM32F37x/SPI/main.c | 15 | ||||
-rw-r--r-- | testhal/STM32F37x/SPI/mcuconf.h | 10 |
4 files changed, 17 insertions, 14 deletions
diff --git a/testhal/STM32F37x/SPI/.project b/testhal/STM32F37x/SPI/.project index c3985659c..b3ceb5b95 100644 --- a/testhal/STM32F37x/SPI/.project +++ b/testhal/STM32F37x/SPI/.project @@ -27,7 +27,7 @@ <link>
<name>board</name>
<type>2</type>
- <locationURI>CHIBIOS/boards/ST_STM32373C_EVAL</locationURI>
+ <locationURI>CHIBIOS/os/hal/boards/ST_STM32373C_EVAL</locationURI>
</link>
<link>
<name>os</name>
diff --git a/testhal/STM32F37x/SPI/halconf.h b/testhal/STM32F37x/SPI/halconf.h index d60800288..461d509b4 100644 --- a/testhal/STM32F37x/SPI/halconf.h +++ b/testhal/STM32F37x/SPI/halconf.h @@ -41,7 +41,7 @@ * @brief Enables the ADC subsystem.
*/
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
-#define HAL_USE_ADC TRUE
+#define HAL_USE_ADC FALSE
#endif
/**
@@ -132,7 +132,7 @@ * @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
-#define HAL_USE_SPI FALSE
+#define HAL_USE_SPI TRUE
#endif
/**
diff --git a/testhal/STM32F37x/SPI/main.c b/testhal/STM32F37x/SPI/main.c index 3a828f3a9..7c005122a 100644 --- a/testhal/STM32F37x/SPI/main.c +++ b/testhal/STM32F37x/SPI/main.c @@ -48,10 +48,11 @@ static uint8_t rxbuf[512]; /*
* SPI bus contender 1.
*/
-static WORKING_AREA(spi_thread_1_wa, 256);
-static msg_t spi_thread_1(void *p) {
+static THD_WORKING_AREA(spi_thread_1_wa, 256);
+static THD_FUNCTION(spi_thread_1, p) {
(void)p;
+
chRegSetThreadName("SPI thread 1");
while (TRUE) {
spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
@@ -69,10 +70,11 @@ static msg_t spi_thread_1(void *p) { /*
* SPI bus contender 2.
*/
-static WORKING_AREA(spi_thread_2_wa, 256);
-static msg_t spi_thread_2(void *p) {
+static THD_WORKING_AREA(spi_thread_2_wa, 256);
+static THD_FUNCTION(spi_thread_2, p) {
(void)p;
+
chRegSetThreadName("SPI thread 2");
while (TRUE) {
spiAcquireBus(&SPID2); /* Acquire ownership of the bus. */
@@ -91,10 +93,11 @@ static msg_t spi_thread_2(void *p) { * This is a periodic thread that does absolutely nothing except flashing
* a LED.
*/
-static WORKING_AREA(blinker_wa, 128);
-static msg_t blinker(void *arg) {
+static THD_WORKING_AREA(blinker_wa, 128);
+static THD_FUNCTION(blinker, arg) {
(void)arg;
+
chRegSetThreadName("blinker");
while (TRUE) {
palSetPad(GPIOC, GPIOC_LED1);
diff --git a/testhal/STM32F37x/SPI/mcuconf.h b/testhal/STM32F37x/SPI/mcuconf.h index f2e3e3def..3747b2b78 100644 --- a/testhal/STM32F37x/SPI/mcuconf.h +++ b/testhal/STM32F37x/SPI/mcuconf.h @@ -62,7 +62,7 @@ /*
* ADC driver system settings.
*/
-#define STM32_ADC_USE_ADC1 TRUE
+#define STM32_ADC_USE_ADC1 FALSE
#define STM32_ADC_USE_SDADC1 FALSE
#define STM32_ADC_USE_SDADC2 FALSE
#define STM32_ADC_USE_SDADC3 FALSE
@@ -81,7 +81,7 @@ /*
* CAN driver system settings.
*/
-#define STM32_CAN_USE_CAN1 TRUE
+#define STM32_CAN_USE_CAN1 FALSE
#define STM32_CAN_CAN1_IRQ_PRIORITY 11
/*
@@ -175,9 +175,9 @@ /*
* SPI driver system settings.
*/
-#define STM32_SPI_USE_SPI1 FALSE
-#define STM32_SPI_USE_SPI2 FALSE
-#define STM32_SPI_USE_SPI3 FALSE
+#define STM32_SPI_USE_SPI1 TRUE
+#define STM32_SPI_USE_SPI2 TRUE
+#define STM32_SPI_USE_SPI3 TRUE
#define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1
#define STM32_SPI_SPI3_DMA_PRIORITY 1
|