aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/UART
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/UART')
-rw-r--r--testhal/STM32/UART/Makefile4
-rw-r--r--testhal/STM32/UART/main.c5
-rw-r--r--testhal/STM32/UART/readme.txt26
3 files changed, 31 insertions, 4 deletions
diff --git a/testhal/STM32/UART/Makefile b/testhal/STM32/UART/Makefile
index 76a8c978e..e430a7678 100644
--- a/testhal/STM32/UART/Makefile
+++ b/testhal/STM32/UART/Makefile
@@ -5,7 +5,7 @@
# Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C++ specific options here (added to USE_OPT).
@@ -62,7 +62,7 @@ include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
-include $(CHIBIOS)/test/test.mk
+#include $(CHIBIOS)/test/test.mk
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
diff --git a/testhal/STM32/UART/main.c b/testhal/STM32/UART/main.c
index e111935d7..121a1f4cb 100644
--- a/testhal/STM32/UART/main.c
+++ b/testhal/STM32/UART/main.c
@@ -73,8 +73,9 @@ static void rxchar(uint16_t c) {
/* Flashing the LED each time a character is received.*/
palClearPad(IOPORT3, GPIOC_LED);
chSysLockFromIsr();
- if (!chVTIsArmedI(&vt2))
- chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
+ if (chVTIsArmedI(&vt2))
+ chVTResetI(&vt2);
+ chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
chSysUnlockFromIsr();
}
diff --git a/testhal/STM32/UART/readme.txt b/testhal/STM32/UART/readme.txt
new file mode 100644
index 000000000..fc111a298
--- /dev/null
+++ b/testhal/STM32/UART/readme.txt
@@ -0,0 +1,26 @@
+*****************************************************************************
+** ChibiOS/RT HAL - UART driver demo for STM32. **
+*****************************************************************************
+
+** TARGET **
+
+The demo will on an Olimex STM32-P103 board.
+
+** The Demo **
+
+The application demonstrates the use of the STM32 UART driver.
+
+** Build Procedure **
+
+The demo has been tested by using the free Codesourcery GCC-based toolchain
+and YAGARTO.
+Just modify the TRGT line in the makefile in order to use different GCC ports.
+
+** Notes **
+
+Some files used by the demo are not part of ChibiOS/RT but are copyright of
+ST Microelectronics and are licensed under a different license.
+Also note that not all the files present in the ST library are distribited
+with ChibiOS/RT, you can find the whole library on the ST web site:
+
+ http://www.st.com