aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-31 06:22:30 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-31 06:22:30 +0000
commita484164f768cdea9b346b2af2c71376e8e260d21 (patch)
tree9837887373002c08698f417ba48575bb4e210f0a /demos
parent330e38629d60553f3d9ab8f544361cdb3deee691 (diff)
downloadChibiOS-a484164f768cdea9b346b2af2c71376e8e260d21.tar.gz
ChibiOS-a484164f768cdea9b346b2af2c71376e8e260d21.tar.bz2
ChibiOS-a484164f768cdea9b346b2af2c71376e8e260d21.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7833 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/Makefile2
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/chconf.h8
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/main.c33
3 files changed, 37 insertions, 6 deletions
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);
}
}