This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Serial application
- To: "Ecos-Discuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] Serial application
- From: Ho Shui Choy Stanley PS03B NCS <scho at ncs dot com dot sg>
- Date: Tue, 8 May 2001 14:03:34 +0800
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.
>