4 a_uint32_t ref_clk = 0;
5 extern a_uint32_t cticks;
9 void cmnos_clock_init_patch(a_uint32_t refclk)
14 // retrieve current clock setting
15 a_uint32_t cmnos_refclk_speed_get_patch(void)
21 // software emulate delay function
22 void cmnos_delay_us_patch(int us)
24 a_uint32_t start_time = NOW();
25 unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us
27 while ( (NOW() - start_time) < num_ticks) {
34 // software emulate microsecond ticks
35 void cmnos_tick_patch(void)
37 static a_uint32_t last_tick = 0;
38 a_uint32_t current_tick = NOW();
39 a_uint32_t delta_tick;
41 delta_tick = (A_UINT32 ) (current_tick - last_tick)/(ref_clk<<10);
44 last_tick = current_tick;
49 // get current sysmem up time in milliseconds based
50 a_uint32_t cmnos_milliseconds_patch(void)