aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-05-09 19:36:30 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-05-09 19:36:30 +0000
commit6d3145c04b2f6be505c44589fdb8ecbe952b4b85 (patch)
treed9b571b3ba3606f742231eeaef62abdafa13d1f0 /test
parent83d50f08219d05f65b55f686e74e5cb4e7352092 (diff)
downloadChibiOS-6d3145c04b2f6be505c44589fdb8ecbe952b4b85.tar.gz
ChibiOS-6d3145c04b2f6be505c44589fdb8ecbe952b4b85.tar.bz2
ChibiOS-6d3145c04b2f6be505c44589fdb8ecbe952b4b85.zip
Fixed more troubles with test_cpu_pulse().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@964 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test')
-rw-r--r--test/test.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test.c b/test/test.c
index aeb2b4058..7d4e3f2b0 100644
--- a/test/test.c
+++ b/test/test.c
@@ -177,13 +177,18 @@ void test_wait_threads(void) {
#if CH_DBG_THREADS_PROFILING
void test_cpu_pulse(unsigned duration) {
+ systime_t start, end, now;
- systime_t end = chThdSelf()->p_time + MS2ST(duration);
- while (chThdSelf()->p_time < end) {
+ start = chThdSelf()->p_time;
+ end = start + MS2ST(duration);
+ do {
+ now = chThdSelf()->p_time;
#if defined(WIN32)
ChkIntSources();
#endif
}
+ while (end > start ? (now >= start) && (now < end) :
+ (now >= start) || (now < end));
}
#endif