[En-Nut-Discussion] timers in nut/os?

Elger Jonker elger.jonker at gmail.com
Tue May 24 12:56:38 CEST 2005


Hi there,

I found some documentation about timers here:
http://www.ethernut.de/api/timer_8h.html

I want to start a timer and read the time at some points and then stop
the timer. I Figured to use the NutTimerStart function from the API;
but there is no documentation about it at all. Could you help me with
this problem?

The function that is somewhat blurrish:
HANDLE  NutTimerStart (u_long ms, void(*callback)(HANDLE, void *),
void *arg, u_char flags)

Here is some source i would like to use:
	HANDLE timer;
	u_long milliseconds;
    u_long meting_1 = 0, meting_2 = 0, meting_3 = 0;

	timer = NutTimerStart (u_long ms, void(*callback)(HANDLE, void *),
void *arg, u_char flags)

	while (meting_1 == 0 || meting_2 == 0 || meting_3 == 0){
		if (PINB7 and meting_1 == 0)
			meting_1 = NutGetMillis();

		if (PINE0 and meting_2 == 0)
			meting_2 = NutGetMillis();

		if (PINE1 and meting_3 == 0)
			meting_3 = NutGetMillis();
	}

	NutTimerStop (timer);

Regards,
Elger Jonker



More information about the En-Nut-Discussion mailing list