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]
Other format: [Raw text]

RE: Help needed for integration of my own serial driver ???


Thanks for the tips, you found my problem. The return values were wrong.
Now everything works fine.

Thanks again.

Pascal

-----Original Message-----
From: Jonathan Larmour [mailto:jifl@ecoscentric.com]
Sent: Thursday, October 17, 2002 11:44 PM
To: Cusson, Pascal
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Help needed for integration of my own serial driver
???


Cusson, Pascal wrote:
> Hi everyone,
>    I am trying to incorporate my serial driver into eCos. As stated in
the documents, I created all the following functions. However, for some 
reason, my serial_handle does not get initialised. If single through the

lookup function, my device is detected and read but the handle does no
get 
initialized at all. Is initialization of the handle my responsability or

eCos' resonsability ?

eCos's, but it only does it on success.

> serial_io_handle_t serial_handle;
> 
> Here is my calling function:
> 
> error=cyg_io_lookup("/dev/ttyS0", &serial_handle);
> 
> Here is my loopup function:
> 
> static Cyg_ErrNo scc1_lookup(struct cyg_devtab_entry **tab, struct
cyg_devtab_entry *sub_tab, const char * name)
> {
>     serial_channel *chan = (serial_channel *)(*tab)->priv;
>     //(chan->callbacks->init_scc1)(chan);  // Really only required for
interrupt driven devices
>     return 1;
> }

You must return 0 (pedantically, ENOERR) for success, not 1.

And you should check the return code from cyg_io_lookup() too.

Jifl
-- 
eCosCentric       http://www.eCosCentric.com/
<info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]--
Opinions==mine

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


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