This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Mail Box Timeout
Hello Eric,
Thanks foe your quick feedback.
Yes. I pass the absolute timeout to cyg_mbox_timed_get()
Howver, the value of cyg_current_time() is always 0 so that the callback
functiob od alarm can't be run repeatedly.
The alarm code is following.
void cyg_start(void)
{
cyg_handle_t counter_hdl;
cyg_handle_t sys_clk;
cyg_handle_t alarm_hdl;
cyg_alarm alarm_obj;
unsigned long index;
sys_clk=cyg_real_time_clock();
cyg_clock_to_counter(sys_clk, &counter_hdl);
cyg_alarm_create(counter_hdl, test_callback, (cyg_addrword_t) &index,
&alarm_hdl, &alarm_obj);
cyg_alarm_initialize(alarm_hdl, cyg_current_time(), 50);
.......
}
void test_callback(cyg_handle_t alarm_handle, cyg_addrword_t data)
{
diag_printf("Alarm is active!\n");
}
Then, the callback function of alarm is executed once only.
Best regards,
Chuck
----- Original Message -----
From: "Eric de Jong" <list_ericdejong_10@gmx.net>
To: <ecos-discuss@sources.redhat.com>
Sent: Monday, July 21, 2003 7:58 PM
Subject: Re: [ECOS] Mail Box Timeout
> Do you pass an absolute timeout to cyg_mbox_timed_get() ? e.g.
> cyg_current_time()+15
>
> cyg_flag_timed_wait uses this, so I guess cyg_mbox_timed_get() uses the
same
> method.
>
> Eric
>
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss