redboot set_comm_baud_rate question

Jani Monoses jani@iv.ro
Fri Jan 23 14:59:00 GMT 2004


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;
}



More information about the Ecos-devel mailing list