24 #ifndef __RFLPC_PROFILING_H__
25 #define __RFLPC_PROFILING_H__
31 #ifdef RFLPC_CONFIG_ENABLE_PROFILING
35 #ifndef RFLPC_PROFILE_PRESCALE
38 #define RFLPC_PROFILE_PRESCALE (rflpc_clock_get_system_clock() / 1000000)
48 #define RFLPC_PROFILE_INIT(timer) do {rflpc_timer_enable(timer); rflpc_timer_set_clock(timer, RFLPC_CCLK); rflpc_timer_set_pre_scale_register(timer,RFLPC_PROFILE_PRESCALE); rflpc_timer_start(timer); } while(0)
53 #define RFLPC_PROFILE_DECLARE_COUNTER(counter) volatile uint32_t rflpc_profile_total_##counter; volatile uint32_t rflpc_profile_start_##counter;
58 #define RFLPC_PROFILE_DECLARE_EXTERN_COUNTER(counter) extern volatile uint32_t rflpc_profile_total_##counter;extern volatile uint32_t rflpc_profile_start_##counter;
61 #define RFLPC_PROFILE_START_COUNTER(counter,timer) do { rflpc_profile_start_##counter = rflpc_timer_get_counter(timer);} while(0)
64 #define RFLPC_PROFILE_STOP_COUNTER(counter,timer) do { rflpc_profile_total_##counter += rflpc_timer_get_counter(timer) - rflpc_profile_start_##counter;} while(0)
67 #define RFLPC_PROFILE_GET_TOTAL(counter) rflpc_profile_total_##counter
TIMER0/1/2/3 device driver.