This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Macro to convert milliseconds into ticks


On Thu, Nov 20, 2008 at 11:57:23AM +0100, Simon Kallweit wrote:
> Hi
> 
> I was looking for a macro to convert fix millisecond intervals into tick 
> counts to be used for cyg_thread_delay(). I didn't found it, and was 
> wondering if there is anything against introducing such a macro?

looking at cdl options CYGNUM_HAL_RTC_*, there is a calculated value:
cdl_option CYGNUM_HAL_RTC_DENOMINATOR (for the most cases this equal
100) 1 Tick = 1000 mS / 100 = 10 mS. You can build some own macro using
those values from pkgconf/kernel.h, but, I have a doubt that you will
get some millisecond non-blocking sleeps less than 10 mS without any
penalty of eCos kernel, i.e. without a mess up with the CYG_HAL_RTC_*
options. So, unix sleep(1) aprox. equal cyg_thread_delay(100), and
usleep(1) something like eCos hal_delay_us(1), but, last is blocking
wait.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]