Ignore:
Timestamp:
Jun 27, 2017, 10:53:32 AM (7 years ago)
Author:
ertl-honda
Message:

3.1.0を反映

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_wo_tecs/trunk/test/test_dlynse.c

    r302 r306  
    55 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    66 *                              Toyohashi Univ. of Technology, JAPAN
    7  *  Copyright (C) 2007-2015 by Embedded and Real-Time Systems Laboratory
     7 *  Copyright (C) 2007-2016 by Embedded and Real-Time Systems Laboratory
    88 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    99 *
     
    5252 *  の責任を負わない.
    5353 *
    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 $
    5555 */
    5656
     
    7575#include "target_kernel_impl.h"
    7676
    77 #define NO_LOOP         ULONG_C(1000000)
     77#define NO_LOOP         1000000UL
    7878
    79 SYSTIM  empty_time;
     79HRTCNT  empty_time;
    8080
    8181static void
     
    9090        etime = fch_hrt();
    9191        empty_time = etime - stime;
     92#ifdef TCYC_HRTCNT
     93        if (etime < stime) {
     94                empty_time += TCYC_HRTCNT;
     95        }
     96#endif /* TCYC_HRTCNT */
    9297        syslog(LOG_NOTICE, "empty loop: %u", empty_time);
    9398        (void) syslog_fls_log();
     
    97102test_dly_nse(ulong_t dlytim)
    98103{
    99         HRTCNT  stime, etime;
     104        HRTCNT  stime, etime, diff;
    100105        ulong_t delay_time;
    101106        volatile ulong_t        i;
     
    106111        }
    107112        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;
    109120        syslog(LOG_NOTICE, "sil_dly_nse(%lu): %lu %s", dlytim, delay_time,
    110121                                                                        delay_time >= dlytim ? "OK" : "NG");
     
    127138        test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 4);
    128139        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);
    129144        test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 10);
    130145        test_dly_nse(SIL_DLY_TIM1 + SIL_DLY_TIM2 * 20);
Note: See TracChangeset for help on using the changeset viewer.