aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-07 15:44:03 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-07 15:44:03 +0000
commita5df28e309adbccff162d67cfb9f55c653c73f7b (patch)
tree901299ccb9636bb8198c2e30aa73ee04cda57e7b /demos
parent905231170094a578c928477b429187e02857247a (diff)
downloadChibiOS-a5df28e309adbccff162d67cfb9f55c653c73f7b.tar.gz
ChibiOS-a5df28e309adbccff162d67cfb9f55c653c73f7b.tar.bz2
ChibiOS-a5df28e309adbccff162d67cfb9f55c653c73f7b.zip
Revised port abstraction layer (PAL), STM32 support adjusted.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1023 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F103-GCC/Makefile1
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c26
2 files changed, 27 insertions, 0 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/Makefile b/demos/ARMCM3-STM32F103-GCC/Makefile
index eb957c072..0fa07c91a 100644
--- a/demos/ARMCM3-STM32F103-GCC/Makefile
+++ b/demos/ARMCM3-STM32F103-GCC/Makefile
@@ -66,6 +66,7 @@ CSRC = ../../ports/ARMCM3/chcore.c \
../../ports/ARMCM3-STM32F103/stm32_serial.c \
${KERNSRC} \
${TESTSRC} \
+ ../../src/lib/pal.c \
../../src/lib/evtimer.c \
board.c main.c
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index f89131d37..f599c3e73 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -24,6 +24,8 @@
#include "board.h"
#include "stm32_serial.h"
+static IOBUS_DECL(LedBus, IOPORT_C, 1, GPIOC_LED);
+
/*
* Red LEDs blinker thread, times are in milliseconds.
*/
@@ -35,6 +37,30 @@ static msg_t Thread1(void *arg) {
chThdSleepMilliseconds(500);
palSetPad(IOPORT_C, GPIOC_LED);
chThdSleepMilliseconds(500);
+ palTogglePad(IOPORT_C, GPIOC_LED);
+ chThdSleepMilliseconds(500);
+ palTogglePad(IOPORT_C, GPIOC_LED);
+ chThdSleepMilliseconds(500);
+ palWritePad(IOPORT_C, GPIOC_LED, PAL_LOW);
+ chThdSleepMilliseconds(500);
+ palWritePad(IOPORT_C, GPIOC_LED, PAL_HIGH);
+ chThdSleepMilliseconds(500);
+ palWriteGroup(IOPORT_C, 1, GPIOC_LED, PAL_LOW);
+ chThdSleepMilliseconds(500);
+ palWriteGroup(IOPORT_C, 1, GPIOC_LED, PAL_HIGH);
+ chThdSleepMilliseconds(500);
+ palClearPort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
+ chThdSleepMilliseconds(500);
+ palSetPort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
+ chThdSleepMilliseconds(500);
+ palTogglePort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
+ chThdSleepMilliseconds(500);
+ palTogglePort(IOPORT_C, PAL_PORT_BIT(GPIOC_LED));
+ chThdSleepMilliseconds(500);
+ palWriteBus(&LedBus, PAL_LOW);
+ chThdSleepMilliseconds(500);
+ palWriteBus(&LedBus, PAL_HIGH);
+ chThdSleepMilliseconds(500);
}
return 0;
}