From a484164f768cdea9b346b2af2c71376e8e260d21 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 31 Mar 2015 06:22:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7833 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/STM32/RT-STM32F407-DISCOVERY/Makefile | 2 +- demos/STM32/RT-STM32F407-DISCOVERY/chconf.h | 8 +++---- demos/STM32/RT-STM32F407-DISCOVERY/main.c | 33 ++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 6 deletions(-) (limited to 'demos/STM32') diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/Makefile b/demos/STM32/RT-STM32F407-DISCOVERY/Makefile index e56e7e88c..dbdde6a0a 100644 --- a/demos/STM32/RT-STM32F407-DISCOVERY/Makefile +++ b/demos/STM32/RT-STM32F407-DISCOVERY/Makefile @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/chconf.h b/demos/STM32/RT-STM32F407-DISCOVERY/chconf.h index 01849821c..110cbe8e0 100644 --- a/demos/STM32/RT-STM32F407-DISCOVERY/chconf.h +++ b/demos/STM32/RT-STM32F407-DISCOVERY/chconf.h @@ -46,7 +46,7 @@ * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#define CH_CFG_ST_FREQUENCY 10000 +#define CH_CFG_ST_FREQUENCY 100000 /** * @brief Time delta constant for the tick-less mode. @@ -333,7 +333,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE +#define CH_DBG_SYSTEM_STATE_CHECK TRUE /** * @brief Debug option, parameters checks. @@ -342,7 +342,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_CHECKS FALSE +#define CH_DBG_ENABLE_CHECKS TRUE /** * @brief Debug option, consistency checks. @@ -352,7 +352,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_ASSERTS FALSE +#define CH_DBG_ENABLE_ASSERTS TRUE /** * @brief Debug option, trace buffer. diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/main.c b/demos/STM32/RT-STM32F407-DISCOVERY/main.c index e6930f4e8..dbcebbba9 100644 --- a/demos/STM32/RT-STM32F407-DISCOVERY/main.c +++ b/demos/STM32/RT-STM32F407-DISCOVERY/main.c @@ -35,6 +35,31 @@ static THD_FUNCTION(Thread1, arg) { } } +virtual_timer_t vt1, vt2, vt3; + +static void cb1(void *p) { + + (void)p; + chSysLockFromISR(); +// if (chVTIsArmedI(&vt1)) +// chVTDoResetI(&vt1); + chSysUnlockFromISR(); +} + +static void cb2(void *p) { + + (void)p; + chSysLockFromISR(); +// if (!chVTIsArmedI(&vt3)) +// chVTDoSetI(&vt3, 19, cb1, NULL); + chSysUnlockFromISR(); +} + +static void cb3(void *p) { + + (void)p; +} + /* * Application entry point. */ @@ -70,6 +95,12 @@ int main(void) { while (TRUE) { if (palReadPad(GPIOA, GPIOA_BUTTON)) TestThread(&SD2); - chThdSleepMilliseconds(500); + chVTSet(&vt1, 7, cb1, NULL); + chThdSleep(5); + chSysLock(); + if (!chVTIsArmedI(&vt2)) + chVTDoSetI(&vt2, 13, cb2, NULL); + chSysUnlock(); +// chVTReset(&vt1); } } -- cgit v1.2.3