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

Function serial_tty_open

components/drivers/serial/serial_tty.c:199–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199static int serial_tty_open(struct lwp_tty *tp)
200{
201 struct serial_tty_context *softc;
202 struct rt_serial_device *serial;
203 rt_err_t error;
204 int oflags;
205
206 softc = tty_softc(tp);
207 serial = softc->parent;
208
209 LOG_D("%s", __func__);
210
211 rt_device_control(&serial->parent, RT_DEVICE_CTRL_CONSOLE_OFLAG, &oflags);
212
213 error = rt_device_open(&serial->parent, oflags);
214
215 if (!error)
216 {
217 /**
218 * to avoid driver accesssing null data,
219 * these are setup only after tty is registered
220 */
221 _setup_serial(serial, tp, softc);
222 }
223 return error;
224}
225
226static void serial_tty_close(struct lwp_tty *tp)
227{

Callers

nothing calls this directly

Calls 3

rt_device_controlFunction · 0.85
rt_device_openFunction · 0.85
_setup_serialFunction · 0.85

Tested by

no test coverage detected