Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/kernel/time_event.c
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/kernel/time_event.c
r321 r429 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN 8 * Copyright (C) 2005-201 6by Embedded and Real-Time Systems Laboratory8 * Copyright (C) 2005-2019 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 49 49 50 50 /* 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 /* 51 58 * TSTEP_HRTCNTの範囲チェック 52 59 */ … … 56 63 57 64 /* 58 * HRTCNT_BOUNDの範囲チェック 59 */ 65 * HRTCNT_BOUNDの定義のチェック 66 */ 67 #ifndef USE_64BIT_HRTCNT 68 60 69 #if HRTCNT_BOUND >= 4294000000U 61 70 #error HRTCNT_BOUND is too large. … … 67 76 #endif /* HRTCNT_BOUND >= TCYC_HRTCNT */ 68 77 #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 */ 69 86 70 87 /* … … 367 384 } 368 385 #endif /* TCYC_HRTCNT */ 386 current_hrtcnt = new_hrtcnt; /*[ASPD1016]*/ 369 387 370 388 previous_evttim = current_evttim; 371 389 current_evttim += (EVTTIM) hrtcnt_advance; /*[ASPD1015]*/ 372 current_hrtcnt = new_hrtcnt; /*[ASPD1016]*/373 390 boundary_evttim = current_evttim - BOUNDARY_MARGIN; /*[ASPD1011]*/ 374 391 … … 407 424 408 425 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 */ 409 432 target_hrt_set_event(HRTCNT_BOUND); /*[ASPD1007]*/ 433 #endif /* USE_64BIT_HRTCNT */ 410 434 } 411 435 else if (EVTTIM_LE(top_evttim, current_evttim)) { … … 414 438 else { 415 439 hrtcnt = (HRTCNT)(top_evttim - current_evttim); 440 #ifdef USE_64BIT_HRTCNT 441 target_hrt_set_event(hrtcnt); 442 #else /* USE_64BIT_HRTCNT */ 416 443 if (hrtcnt > HRTCNT_BOUND) { 417 444 target_hrt_set_event(HRTCNT_BOUND); /*[ASPD1006]*/ … … 420 447 target_hrt_set_event(hrtcnt); /*[ASPD1002]*/ 421 448 } 449 #endif /* USE_64BIT_HRTCNT */ 422 450 } 423 451 } … … 442 470 * 443 471 */ 444 #ifdef TOPPERS_tmeenq 472 #ifdef TOPPERS_tmeenqrel 445 473 446 474 void 447 tmevtb_enqueue (TMEVTB *p_tmevtb, RELTIM time)475 tmevtb_enqueue_reltim(TMEVTB *p_tmevtb, RELTIM time) 448 476 { 449 477 /* … … 467 495 } 468 496 469 #endif /* TOPPERS_tmeenq */497 #endif /* TOPPERS_tmeenqrel */ 470 498 471 499 /* … … 502 530 503 531 bool_t 504 check_adjtim(int _t adjtim)532 check_adjtim(int32_t adjtim) 505 533 { 506 534 if (adjtim > 0) { 507 535 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)); 509 537 } 510 538 else if (adjtim < 0) { /*[NGKI3589]*/ … … 559 587 TMEVTB *p_tmevtb; 560 588 bool_t callflag; 589 #ifndef TOPPERS_OMIT_SYSLOG 590 uint_t nocall = 0; 591 #endif /* TOPPERS_OMIT_SYSLOG */ 561 592 562 593 assert(sense_context()); … … 587 618 (*(p_tmevtb->callback))(p_tmevtb->arg); 588 619 callflag = true; 620 #ifndef TOPPERS_OMIT_SYSLOG 621 nocall += 1; 622 #endif /* TOPPERS_OMIT_SYSLOG */ 589 623 } 590 624 } while (callflag); /*[ASPD1020]*/ 591 625 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 592 635 /* 593 636 * 高分解能タイマ割込みの発生タイミングを設定する[ASPD1025].
Note:
See TracChangeset
for help on using the changeset viewer.