728x90
반응형
RTME의 기본 Tick의 크기는 10ms로 설정되어 있음.
RTEMS의 기본 tick 설정은 /data/_rtems/rtems-docker/src/rtems/cpukit/include/rtems/confdefs/clock.h 에서 확인
#ifndef CONFIGURE_MICROSECONDS_PER_TICK
#define CONFIGURE_MICROSECONDS_PER_TICK 10000 // 기본값: 10ms
#endif따라서 더 정밀한 Tick 설정을 위해 아래와 같은 설정을 사용하면됨
// 1ms tick으로 설정
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
// 또는 100μs tick으로 설정
#define CONFIGURE_MICROSECONDS_PER_TICK 100테스트 코드
#define CONFIGURE_MICROSECONDS_PER_TICK 10000 //DEFAULT
printf("CHECK 5 ns\n");
int start_ticks = rtems_clock_get_ticks_since_boot();
uint32_t start_time = rtems_clock_get_uptime_nanoseconds();
while(rtems_clock_get_ticks_since_boot() - start_ticks < 5) {
}
uint32_t end_time = rtems_clock_get_uptime_nanoseconds();
printf("5 TICK ns: %d\n", (end_time - start_time));
CHECK 5 ns
5 TICK ns: 49,482,240
INIT CPU : 0
#define CONFIGURE_MICROSECONDS_PER_TICK 1000
printf("CHECK 5 ns\n");
int start_ticks = rtems_clock_get_ticks_since_boot();
uint32_t start_time = rtems_clock_get_uptime_nanoseconds();
while(rtems_clock_get_ticks_since_boot() - start_ticks < 5) {
}
uint32_t end_time = rtems_clock_get_uptime_nanoseconds();
printf("5 TICK ns: %d\n", (end_time - start_time));
CHECK 5 ns
5 TICK ns: 4,482,440
INIT CPU : 0728x90
반응형
'# RTEMS' 카테고리의 다른 글
| RTEMS 'rtems_rate_monotonic_period'는 정말 "주기적"일까? (0) | 2025.11.04 |
|---|---|
| [RTEMS] 캐시 사이즈 측정 (0) | 2025.09.25 |
| [RTEMS] double 소수점 출력 함수 구현 (0) | 2025.09.11 |
| [RTEMS] 수행 시간 (0) | 2025.09.11 |
| [RTEMS] FPU(부동소수점 처리 장치, Floating-Point Unit) 활성화 (0) | 2025.09.11 |