* Re: [ECOS] cyg_io_read
[not found] <20050315033604.77080.qmail@web60809.mail.yahoo.com>
@ 2005-03-15 14:21 ` Marco SICHERI [CTS]
0 siblings, 0 replies; only message in thread
From: Marco SICHERI [CTS] @ 2005-03-15 14:21 UTC (permalink / raw)
To: baljeet singh; +Cc: eCos Discus.List, eCos Dev.List
Hi Baljeet,
I do this...
Good work!
//
// -----
CPSUARTGetChar -----------------------------------------------------
//
BYTE CPSUARTGetChar(BYTE uartID, BYTE *charD)
{
BYTE rc = CPSRC_OK;
//
// Controllo uart valida e pronta
//
rc = _CTSUARTCheckUartReady(uartID);
if (rc == CPSRC_UART_NOTREADY)
{
//
// Aprire la uart
//
rc = _CTSUARTOpenUart(uartID);
}
//
// Porta pronta, controlliamo i dati!
//
if (rc == CPSRC_OK)
{
if (cyg_io_select(ctsUartHandle[uartID], CYG_FREAD, uartInfo) == false)
return (CPSRC_UART_NOTREADY);
else
{
cyg_uint32 dataToRead = 1;
if (cyg_io_read(ctsUartHandle[uartID], &charD[0], &dataToRead))
return (CPSRC_UART_NOTREADY);
}
}
return (rc);
}
Ossequi, (Best Regards/Obrigado)
Marco SICHERI
CTS electronics - R&D Department
phone: +39 0125 235637, +39 0125 235630
e-mail: m.sicheri@ctsgroup.it
http://www.ctsgroup.it
----- Original Message -----
From: "baljeet singh" <baljeet45@yahoo.com>
To: <ecos-discuss@sources.redhat.com>
Sent: Tuesday, March 15, 2005 4:36 AM
Subject: [ECOS] cyg_io_read
> All,
> one of the parameters in the cyg_io_read(..) is
> the number of bytes to read. Process blocks till
> specified number of bytes have been read. If the
> specified number of bytes is not received, the
> process stays blocked.
> Question: Is there a way to block the process for
> a specified amount of time such that the prcoess
> should return on either receiving the specified
> number of bytes or when the specified delay times
> out?
> Baljeet
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-15 14:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20050315033604.77080.qmail@web60809.mail.yahoo.com>
2005-03-15 14:21 ` [ECOS] cyg_io_read Marco SICHERI [CTS]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).