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

Function _serial_tty_set_speed

components/drivers/serial/serial_tty.c:143–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143static void _serial_tty_set_speed(struct lwp_tty *tp)
144{
145 struct serial_tty_context *softc = (struct serial_tty_context *)(tp->t_devswsoftc);
146 struct rt_serial_device *serial;
147 struct termios serial_hw_config;
148
149 RT_ASSERT(softc);
150 serial = softc->parent;
151
152 rt_device_control(&(serial->parent), TCGETS, &serial_hw_config);
153 tp->t_termios_init_in.c_cflag |= serial_hw_config.c_cflag;
154
155 tp->t_termios_init_in.__c_ispeed = tp->t_termios_init_in.__c_ospeed = cfgetospeed(&tp->t_termios_init_in);
156}
157
158static int _serial_isbusy(struct rt_serial_device *serial)
159{

Callers 1

Calls 2

rt_device_controlFunction · 0.85
cfgetospeedFunction · 0.85

Tested by

no test coverage detected