Changeset 306 for asp3_wo_tecs/trunk/test/test_dlynse.c
- Timestamp:
- Jun 27, 2017, 10:53:32 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_wo_tecs/trunk/test/test_dlynse.c
r302 r306 5 5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 6 6 * Toyohashi Univ. of Technology, JAPAN 7 * Copyright (C) 2007-201 5by Embedded and Real-Time Systems Laboratory7 * Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory 8 8 * Graduate School of Information Science, Nagoya Univ., JAPAN 9 9 * … … 52 52 * ã®è²¬ä»»ãè² ããªãï¼ 53 53 * 54 * $Id: test_dlynse.c 482 2016-01-03 13:12:51Z ertl-hiro $54 * $Id: test_dlynse.c 738 2016-04-05 14:19:24Z ertl-hiro $ 55 55 */ 56 56 … … 75 75 #include "target_kernel_impl.h" 76 76 77 #define NO_LOOP ULONG_C(1000000)77 #define NO_LOOP 1000000UL 78 78 79 SYSTIMempty_time;79 HRTCNT empty_time; 80 80 81 81 static void … … 90 90 etime = fch_hrt(); 91 91 empty_time = etime - stime; 92 #ifdef TCYC_HRTCNT 93 if (etime < stime) { 94 empty_time += TCYC_HRTCNT; 95 } 96 #endif /* TCYC_HRTCNT */ 92 97 syslog(LOG_NOTICE, "empty loop: %u", empty_time); 93 98 (void) syslog_fls_log(); … … 97 102 test_dly_nse(ulong_t dlytim) 98 103 { 99 HRTCNT stime, etime ;104 HRTCNT stime, etime, diff; 100 105 ulong_t delay_time; 101 106 volatile ulong_t i; … … 106 111 } 107 112 etime = fch_hrt(); 108 delay_time = ((etime - stime) - empty_time) / 1000U; 113 diff = etime - stime; 114 #ifdef TCYC_HRTCNT 115 if (etime < stime) { 116 diff += TCYC_HRTCNT; 117 } 118 #endif /* TCYC_HRTCNT */ 119 delay_time = (diff - empty_time) / 1000U; 109 120 syslog(LOG_NOTICE, "sil_dly_nse(%lu): %lu %s", dlytim, delay_time, 110 121 delay_time >= dlytim ? "OK" : "NG"); … … 127 138 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 4); 128 139 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 5); 140 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 6); 141 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 7); 142 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 8); 143 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 9); 129 144 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 10); 130 145 test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 20);
Note:
See TracChangeset
for help on using the changeset viewer.