Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/kernel/time_event.c

    r321 r429  
    66 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    77 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
     8 *  Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory
    99 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    1010 *
     
    4949
    5050/*
     51 *  TCYC_HRTCNTの定義のチェック
     52 */
     53#if defined(USE_64BIT_HRTCNT) && defined(TCYC_HRTCNT)
     54#error TCYC_HRTCNT must not be defined when USE_64BIT_HRTCNT.
     55#endif
     56
     57/*
    5158 *  TSTEP_HRTCNTの範囲チェック
    5259 */
     
    5663
    5764/*
    58  *  HRTCNT_BOUNDの範囲チェック
    59  */
     65 *  HRTCNT_BOUNDの定義のチェック
     66 */
     67#ifndef USE_64BIT_HRTCNT
     68
    6069#if HRTCNT_BOUND >= 4294000000U
    6170#error HRTCNT_BOUND is too large.
     
    6776#endif /* HRTCNT_BOUND >= TCYC_HRTCNT */
    6877#endif /* TCYC_HRTCNT */
     78
     79#else /* USE_64BIT_HRTCNT */
     80
     81#ifdef HRTCNT_BOUND
     82#error USE_64BIT_HRTCNT is not supported on this target.
     83#endif /* HRTCNT_BOUND */
     84
     85#endif /* USE_64BIT_HRTCNT */
    6986
    7087/*
     
    367384        }
    368385#endif /* TCYC_HRTCNT */
     386        current_hrtcnt = new_hrtcnt;                                    /*[ASPD1016]*/
    369387
    370388        previous_evttim = current_evttim;
    371389        current_evttim += (EVTTIM) hrtcnt_advance;              /*[ASPD1015]*/
    372         current_hrtcnt = new_hrtcnt;                                    /*[ASPD1016]*/
    373390        boundary_evttim = current_evttim - BOUNDARY_MARGIN;     /*[ASPD1011]*/
    374391
     
    407424
    408425        if (p_last_tmevtn < p_top_tmevtn) {
     426                /*
     427                 *  タイムイベントがない場合
     428                 */
     429#ifdef USE_64BIT_HRTCNT
     430                target_hrt_clear_event();
     431#else /* USE_64BIT_HRTCNT */
    409432                target_hrt_set_event(HRTCNT_BOUND);                     /*[ASPD1007]*/
     433#endif /* USE_64BIT_HRTCNT */
    410434        }
    411435        else if (EVTTIM_LE(top_evttim, current_evttim)) {
     
    414438        else {
    415439                hrtcnt = (HRTCNT)(top_evttim - current_evttim);
     440#ifdef USE_64BIT_HRTCNT
     441                target_hrt_set_event(hrtcnt);
     442#else /* USE_64BIT_HRTCNT */
    416443                if (hrtcnt > HRTCNT_BOUND) {
    417444                        target_hrt_set_event(HRTCNT_BOUND);             /*[ASPD1006]*/
     
    420447                        target_hrt_set_event(hrtcnt);                   /*[ASPD1002]*/
    421448                }
     449#endif /* USE_64BIT_HRTCNT */
    422450        }
    423451}
     
    442470 * 
    443471 */
    444 #ifdef TOPPERS_tmeenq
     472#ifdef TOPPERS_tmeenqrel
    445473
    446474void
    447 tmevtb_enqueue(TMEVTB *p_tmevtb, RELTIM time)
     475tmevtb_enqueue_reltim(TMEVTB *p_tmevtb, RELTIM time)
    448476{
    449477        /*
     
    467495}
    468496
    469 #endif /* TOPPERS_tmeenq */
     497#endif /* TOPPERS_tmeenqrel */
    470498
    471499/*
     
    502530
    503531bool_t
    504 check_adjtim(int_t adjtim)
     532check_adjtim(int32_t adjtim)
    505533{
    506534        if (adjtim > 0) {
    507535                return(p_last_tmevtn >= p_top_tmevtn    /*[NGKI3588]*/
    508                                         && EVTTIM_LE(top_evttim, current_evttim - TMAX_ADJTIM));
     536                                        && EVTTIM_LE(top_evttim + TMAX_ADJTIM, current_evttim));
    509537        }
    510538        else if (adjtim < 0) {                                          /*[NGKI3589]*/
     
    559587        TMEVTB  *p_tmevtb;
    560588        bool_t  callflag;
     589#ifndef TOPPERS_OMIT_SYSLOG
     590        uint_t  nocall = 0;
     591#endif /* TOPPERS_OMIT_SYSLOG */
    561592
    562593        assert(sense_context());
     
    587618                        (*(p_tmevtb->callback))(p_tmevtb->arg);
    588619                        callflag = true;
     620#ifndef TOPPERS_OMIT_SYSLOG
     621                        nocall += 1;
     622#endif /* TOPPERS_OMIT_SYSLOG */
    589623                }
    590624        } while (callflag);                                                             /*[ASPD1020]*/
    591625
     626#ifndef TOPPERS_OMIT_SYSLOG
     627        /*
     628         *  タイムイベントが処理されなかった場合.
     629         */
     630        if (nocall == 0) {
     631                syslog_0(LOG_NOTICE, "no time event is processed in hrt interrupt.");
     632        }
     633#endif /* TOPPERS_OMIT_SYSLOG */
     634
    592635        /*
    593636         *  高分解能タイマ割込みの発生タイミングを設定する[ASPD1025].
Note: See TracChangeset for help on using the changeset viewer.