This is the mail archive of the ecos-devel@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]