This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
redboot set_comm_baud_rate question
- From: Jani Monoses <jani at iv dot ro>
- To: ecos-devel at sources dot redhat dot com
- Date: Fri, 23 Jan 2004 17:01:27 +0200
- Subject: redboot set_comm_baud_rate question
Hi
I just want to make sure is the code below intended to be a retry
of setting of the baudrate if the first attempt fails or a conditional
setting of it if it's already at the requested value in which case it
should have been a GETBAUD operation instead of the first SETBAUD.
thanks
Jani
static int
set_comm_baud_rate(hal_virtual_comm_table_t *chan, int rate)
{
int current_rate;
current_rate = CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_SETBAUD, rate);
if (rate != current_rate)
return CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_SETBAUD, rate);
return 0;
}