Mercurial > ecos
diff packages/devs/serial/sh/cq7708/current/src/sh_sci_serial.c @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | 5a0cc6c243a9 |
| children |
line wrap: on
line diff
--- a/packages/devs/serial/sh/cq7708/current/src/sh_sci_serial.c +++ b/packages/devs/serial/sh/cq7708/current/src/sh_sci_serial.c @@ -140,7 +140,8 @@ static Cyg_ErrNo sh_serial_lookup(struct struct cyg_devtab_entry *sub_tab, const char *name); static unsigned char sh_serial_getc(serial_channel *chan); -static bool sh_serial_set_config(serial_channel *chan, cyg_serial_info_t *config); +static Cyg_ErrNo sh_serial_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len); static void sh_serial_start_xmit(serial_channel *chan); static void sh_serial_stop_xmit(serial_channel *chan); @@ -329,10 +330,26 @@ sh_serial_getc(serial_channel *chan) } // Set up the device characteristics; baud rate, etc. -static bool -sh_serial_set_config(serial_channel *chan, cyg_serial_info_t *config) +static Cyg_ErrNo +sh_serial_set_config(serial_channel *chan, cyg_uint32 key, + const void *xbuf, cyg_uint32 *len) { - return sh_serial_config_port(chan, config, false); + switch (key) { + case CYG_IO_SET_CONFIG_SERIAL_INFO: + { + cyg_serial_info_t *config = (cyg_serial_info_t *)xbuf; + if ( *len < sizeof(cyg_serial_info_t) ) { + return -EINVAL; + } + *len = sizeof(cyg_serial_info_t); + if ( true != sh_serial_config_port(chan, config, false) ) + return -EINVAL; + } + break; + default: + return -EINVAL; + } + return ENOERR; } // Enable the transmitter on the device
