This is the mail archive of the ecos-discuss@sourceware.org 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]

RE: MPC555 serial driver delay




>mpc555_serial_putc() should return false when the buffer is 
>full. This tells serial_xmt_char() to stop sending bytes, and 
>so the DSR should exist.

It does, but I didn't understand why it should ever need to, the very
fact that it is being called should mean (in this context) that there is
space for a byte as this is what caused the interrupt in the first
place.

>If i understand you correctly, you are seeing a busy loop 
>somewhere? Where is this loop?
>
>      Andrew
>

Ok, I see how it works now, it will only try once to send again and then
breaks out of the while loop when the last byte hasn't finished sending.

static void
serial_xmt_char(serial_channel *chan)
{
...
    while (cbuf->nb > 0) {
        c = cbuf->data[cbuf->get];
        if ((funs->putc)(chan, c)) {
            cbuf->get++;
            if (cbuf->get == cbuf->len) cbuf->get = 0;
            cbuf->nb--;
        } else {
            // See if there is now enough room to restart writer
            space = cbuf->len - cbuf->nb;
            if (space >= cbuf->low_water) {
                if (cbuf->waiting) {
                    cbuf->waiting = false;
                    cyg_drv_cond_broadcast(&cbuf->wait);
                }
            }
            return;  // Need to wait for more space
        }
    }
...   
 (funs->stop_xmit)(chan);  // Done with transmit                
}

So that wasn't the problem. I've tried setting the buffer to 1 and the
delay problem is still there. 
I'm not sure where to look now.

Any ideas?

Thanks,

Steven

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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