aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARMCM3-STM32F103-GCC/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 09:33:11 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-02 09:33:11 +0000
commit8ada44e092e20e825b78c3d25ee016861cf886a9 (patch)
treee013e80e54c989b0fea0688f57e8aea448de207c /demos/ARMCM3-STM32F103-GCC/main.c
parente20aaf6c29fc5ca91e059bbca8194c8ad7c516b9 (diff)
downloadChibiOS-8ada44e092e20e825b78c3d25ee016861cf886a9.tar.gz
ChibiOS-8ada44e092e20e825b78c3d25ee016861cf886a9.tar.bz2
ChibiOS-8ada44e092e20e825b78c3d25ee016861cf886a9.zip
Modified the STM32 demo to use the new I/O port driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1010 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARMCM3-STM32F103-GCC/main.c')
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index ec59c4ffd..01e4eaab5 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -21,6 +21,7 @@
#include <test.h>
#include "board.h"
+#include "ioports.h"
#include "stm32_serial.h"
/*
@@ -30,9 +31,9 @@ static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
- GPIOC->BRR = GPIOC_LED;
+ chPortClear(IOPORT_C, GPIOC_LED);
chThdSleepMilliseconds(500);
- GPIOC->BSRR = GPIOC_LED;
+ chPortSet(IOPORT_C, GPIOC_LED);
chThdSleepMilliseconds(500);
}
return 0;
@@ -54,7 +55,7 @@ int main(int argc, char **argv) {
* sleeping in a loop and check the button state.
*/
while (TRUE) {
- if (GPIOA->IDR & GPIOA_BUTTON)
+ if (chPortRead(IOPORT_A) & GPIOA_BUTTON)
TestThread(&COM2);
chThdSleepMilliseconds(500);
}