aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-01 19:18:09 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-01 19:18:09 +0000
commit639d957e5eacffffb849b976552b39a2b66433aa (patch)
treeaa919ffa72219ad110129d7e953dea456d632b80 /demos
parentbf464a835d40efa0f766e5602bf0cd566ce48327 (diff)
downloadChibiOS-639d957e5eacffffb849b976552b39a2b66433aa.tar.gz
ChibiOS-639d957e5eacffffb849b976552b39a2b66433aa.tar.bz2
ChibiOS-639d957e5eacffffb849b976552b39a2b66433aa.zip
Bug 2890382.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1263 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index fcc496648..943509849 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -19,15 +19,16 @@
#include <ch.h>
#include <pal.h>
+#include <serial.h>
+#include <spi.h>
#include <test.h>
#include "board.h"
-#include "serial.h"
/*
* Red LEDs blinker thread, times are in milliseconds.
*/
-static WORKING_AREA(waThread1, 128);
+static WORKING_AREA(waThread1, 512);
static msg_t Thread1(void *arg) {
(void)arg;
@@ -40,6 +41,10 @@ static msg_t Thread1(void *arg) {
return 0;
}
+static SPIConfig spicfg = {
+ 16, IOPORT1, 4, 0
+};
+
/*
* Entry point, note, the main() function is already a thread in the system
* on entry.
@@ -59,6 +64,11 @@ int main(int argc, char **argv) {
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+ palSetPadMode(IOPORT1, 4, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(IOPORT1, 4);
+ spiStart(&SPID1, &spicfg);
+ spiStop(&SPID1);
+
/*
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the button state.