- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/arch/arm_gcc/rza1/chip_timer.h
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-2018 by Embedded and Real-Time Systems Laboratory 9 9 * Graduate School of Information Science, Nagoya Univ., JAPAN 10 10 * … … 51 51 #define TOPPERS_CHIP_TIMER_H 52 52 53 #include "kernel/kernel_impl.h" 53 54 #include <sil.h> 54 55 #include "rza1.h" … … 140 141 * 生させるように設定する. 141 142 */ 142 extern void target_hrt_set_event(HRTCNT hrtcnt); 143 Inline void 144 target_hrt_set_event(HRTCNT hrtcnt) 145 { 146 uint32_t cnt = hrtcnt * 33 + hrtcnt / 3 + 1; 147 uint32_t current; 148 149 /* 150 * 現在のカウント値を読み,hrtcnt後に割込みが発生するように設定する. 151 */ 152 current = sil_rew_mem(OSTM_CNT(OSTM0_BASE)); 153 sil_wrw_mem(OSTM_CMP(OSTM0_BASE), current + cnt); 154 155 /* 156 * 上で現在のカウント値を読んで以降に,cnt以上カウントアップしてい 157 * た場合には,割込みを発生させる. 158 */ 159 if (sil_rew_mem(OSTM_CNT(OSTM0_BASE)) - current >= cnt) { 160 raise_int(INTNO_OSTM0); 161 } 162 } 143 163 144 164 /* 145 165 * 高分解能タイマ割込みの要求 146 166 */ 147 extern void target_hrt_raise_event(void); 167 Inline void 168 target_hrt_raise_event(void) 169 { 170 raise_int(INTNO_OSTM0); 171 } 148 172 149 173 /* … … 184 208 * オーバランタイマの停止 185 209 */ 186 extern PRCTIM target_ovrtimer_stop(void); 210 Inline PRCTIM 211 target_ovrtimer_stop(void) 212 { 213 uint32_t cnt; 214 215 /* 216 * OSタイマを停止する. 217 */ 218 sil_wrb_mem(OSTM_TT(OSTM1_BASE), OSTM_TT_STOP); 219 220 if (probe_int(INTNO_OSTM1)) { 221 /* 222 * 割込み要求が発生している場合 223 */ 224 clear_int(INTNO_OSTM1); 225 return(0U); 226 } 227 else { 228 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE)); 229 return((PRCTIM)((cnt + 34) / 5 * 3 / 20)); 230 } 231 } 187 232 188 233 /* 189 234 * オーバランタイマの現在値の読出し 190 235 */ 191 extern PRCTIM target_ovrtimer_get_current(void); 236 Inline PRCTIM 237 target_ovrtimer_get_current(void) 238 { 239 uint32_t cnt; 240 241 if (probe_int(INTNO_OSTM1)) { 242 /* 243 * 割込み要求が発生している場合 244 */ 245 return(0U); 246 } 247 else { 248 cnt = sil_rew_mem(OSTM_CNT(OSTM1_BASE)); 249 return((PRCTIM)((cnt + 34) / 5 * 3 / 20)); 250 } 251 } 192 252 193 253 /*
Note:
See TracChangeset
for help on using the changeset viewer.