diff options
Diffstat (limited to 'testhal/STM32F0xx/UART')
-rw-r--r-- | testhal/STM32F0xx/UART/.project | 2 | ||||
-rw-r--r-- | testhal/STM32F0xx/UART/chconf.h | 8 | ||||
-rw-r--r-- | testhal/STM32F0xx/UART/main.c | 20 |
3 files changed, 14 insertions, 16 deletions
diff --git a/testhal/STM32F0xx/UART/.project b/testhal/STM32F0xx/UART/.project index d05252ac5..03d8ce7d4 100644 --- a/testhal/STM32F0xx/UART/.project +++ b/testhal/STM32F0xx/UART/.project @@ -27,7 +27,7 @@ <link>
<name>board</name>
<type>2</type>
- <locationURI>CHIBIOS/boards/ST_STM32F0_DISCOVERY</locationURI>
+ <locationURI>CHIBIOS/os/hal/boards/ST_STM32F0_DISCOVERY</locationURI>
</link>
<link>
<name>os</name>
diff --git a/testhal/STM32F0xx/UART/chconf.h b/testhal/STM32F0xx/UART/chconf.h index 9864162ac..045129dac 100644 --- a/testhal/STM32F0xx/UART/chconf.h +++ b/testhal/STM32F0xx/UART/chconf.h @@ -41,7 +41,7 @@ * setting also defines the system tick time unit.
*/
#if !defined(CH_CFG_ST_FREQUENCY) || defined(__DOXYGEN__)
-#define CH_CFG_ST_FREQUENCY 1000
+#define CH_CFG_ST_FREQUENCY 10000
#endif
/**
@@ -62,7 +62,7 @@ * this value.
*/
#if !defined(CH_CFG_TIMEDELTA) || defined(__DOXYGEN__)
-#define CH_CFG_TIMEDELTA 0
+#define CH_CFG_TIMEDELTA 2
#endif
/**
@@ -357,7 +357,7 @@ * @note The default is @p FALSE.
*/
#if !defined(CH_DBG_STATISTICS) || defined(__DOXYGEN__)
-#define CH_DBG_STATISTICS TRUE
+#define CH_DBG_STATISTICS FALSE
#endif
/**
@@ -441,7 +441,7 @@ * tickless mode.
*/
#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
-#define CH_DBG_THREADS_PROFILING TRUE
+#define CH_DBG_THREADS_PROFILING FALSE
#endif
/** @} */
diff --git a/testhal/STM32F0xx/UART/main.c b/testhal/STM32F0xx/UART/main.c index aa52aeb77..9df75bb9d 100644 --- a/testhal/STM32F0xx/UART/main.c +++ b/testhal/STM32F0xx/UART/main.c @@ -17,15 +17,15 @@ #include "ch.h"
#include "hal.h"
-static VirtualTimer vt1, vt2;
+static virtual_timer_t vt1, vt2;
static void restart(void *p) {
(void)p;
- chSysLockFromIsr();
+ chSysLockFromISR();
uartStartSendI(&UARTD1, 14, "Hello World!\r\n");
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
static void ledoff(void *p) {
@@ -51,11 +51,10 @@ static void txend2(UARTDriver *uartp) { (void)uartp;
palClearPad(GPIOC, GPIOC_LED4);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt1))
- chVTResetI(&vt1);
+ chSysLockFromISR();
+ chVTResetI(&vt1);
chVTSetI(&vt1, MS2ST(5000), restart, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
@@ -78,11 +77,10 @@ static void rxchar(UARTDriver *uartp, uint16_t c) { (void)c;
/* Flashing the LED each time a character is received.*/
palSetPad(GPIOC, GPIOC_LED4);
- chSysLockFromIsr();
- if (chVTIsArmedI(&vt2))
- chVTResetI(&vt2);
+ chSysLockFromISR();
+ chVTResetI(&vt2);
chVTSetI(&vt2, MS2ST(200), ledoff, NULL);
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
}
/*
|