Dear Graeme Russ, In message <4ddbe22d.6050...@gmail.com> you wrote: > > >> Why must get_timer() be used to perform "meaningful time measurement?" > > > > Excellent question! It was never intended to be used as such. > > Because get_timer() as it currently stands can as it is assumed to return > milliseconds
Yes, but without any guarantee for accuracy or resolution. This is good enough for timeouts, but nothing for time measurements. > OK, let's wind back - My original suggestion made no claim towards changing > what the API is used for, or how it looks to those who use it (for all > practical intents and purposes). I suggested: > - Removing set_timer() and reset_timer() > - Implement get_timer() as a platform independent function Trying to remember what I have read in this thread I believe we have an agreement on these. > Exposing ticks and tick_frequency to everyone via a 'tick' HAL I skip this. I don't even read it. > ======================= > Not exposing ticks and tick_frequency to everyone > > In /lib/timer.c > > void prescaler(u32 ticks, u32 tick_frequency) > { > u32 current_ms; > > /* Bill's algorithm */ > > /* result stored in gd->timer_in_ms; */ > } > > In /arch/cpu/soc/timer.c or /arch/cpu/timer.c or /board/<board>/timer.c > > static u32 get_ticks(void) Currently we have unsigned long long get_ticks(void) which is better as it matches existing hardware. Note that we also have void wait_ticks(u32) as needed for udelay(). > static u32 get_tick_frequency(void) > { > u32 tick_frequency; > > /* Determine tick frequency */ > > return tick_frequency; > } Note that we also have u32 usec2ticks(u32 usec) and u32 ticks2usec(u32 ticks). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Madness has no purpose. Or reason. But it may have a goal. -- Spock, "The Alternative Factor", stardate 3088.7 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot