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

RE: Serial application


Solve the problem already. Somehow in /io/serial/currentsrc/common/serial.c,
in serial_read function, the checking for blocking was wrong.

-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [mailto:scho@ncs.com.sg]
Sent: Tuesday, May 08, 2001 14:04
To: Ecos-Discuss (E-mail)
Subject: [ECOS] Serial application


I wrote a test program to test the serial port on my platform (AT91EB40).
This program simply transfer data received from one port to the other. I
have two threads, each will monitor one serial port. Below is the codes.

Thread 1:
static void simple_prog1(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial1, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial0, in_buffer, &buf_len);
    }
}

Thread 2:
static void simple_prog2(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial0, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial1, in_buffer, &buf_len);
    }
}

When I start the program, it just run for a few seconds then stops. Can
anyone tell me what's wrong?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 


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