This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Macro to convert milliseconds into ticks
- From: Sergei Gavrikov <sg at belvok dot com>
- To: Simon Kallweit <simon dot kallweit at intefo dot ch>
- Cc: eCos Disuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 20 Nov 2008 13:47:49 +0200
- Subject: Re: [ECOS] Macro to convert milliseconds into ticks
- References: <49254293.1030309@intefo.ch>
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