MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / serial_tty_param

Function serial_tty_param

components/drivers/serial/serial_tty.c:258–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258static int serial_tty_param(struct lwp_tty *tp, struct termios *t)
259{
260 struct serial_tty_context *softc = (struct serial_tty_context *)(tp->t_devswsoftc);
261 struct rt_serial_device *serial;
262
263 RT_ASSERT(softc);
264 serial = softc->parent;
265
266 if (!tty_opened(tp))
267 {
268 /**
269 * skip configure on open since all configs are copied from the current
270 * configuration on device. So we don't bother to set it back to device
271 * again.
272 */
273 return RT_EOK;
274 }
275
276 cfsetispeed(t, t->__c_ispeed);
277 return rt_device_control(&(serial->parent), TCSETS, t);
278}
279
280static struct lwp_ttydevsw serial_ttydevsw = {
281 .tsw_open = serial_tty_open,

Callers

nothing calls this directly

Calls 2

cfsetispeedFunction · 0.85
rt_device_controlFunction · 0.85

Tested by

no test coverage detected