Skip to content

Commit

Permalink
Rename tty_(set|clr)_rts to tty_set_(tx|rx)
Browse files Browse the repository at this point in the history
  • Loading branch information
3cky committed Nov 27, 2023
1 parent b03d50b commit 68f9880
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ conn_write(int d, void *buf, size_t nbytes, int istty)
#ifdef TRXCTL
if (istty && cfg.trxcntl != TRX_ADDC)
{
tty_set_rts(d);
tty_set_tx(d);
tty_delay(35000000l/cfg.ttyspeed);
}
#endif
Expand All @@ -267,7 +267,7 @@ conn_write(int d, void *buf, size_t nbytes, int istty)
if (istty && cfg.trxcntl != TRX_ADDC )
{
tty_delay(DV(nbytes, tty.bpc, cfg.ttyspeed));
tty_clr_rts(d);
tty_set_rx(d);
}
#endif

Expand Down
10 changes: 5 additions & 5 deletions src/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ tty_set_attr(ttydata_t *mod)
return RC_ERR;
tcflush(mod->fd, TCIOFLUSH);
#ifdef TRXCTL
tty_clr_rts(mod->fd);
tty_set_rx(mod->fd);
#endif
#ifdef HAVE_TIOCRS485
if (mod->rs485)
Expand Down Expand Up @@ -465,9 +465,9 @@ void sysfs_gpio_set(char *filename, char *value) {

}

/* Set RTS line to active state */
/* Set tty device into transmit mode */
void
tty_set_rts(int fd)
tty_set_tx(int fd)
{
if ( TRX_RTS_1 == cfg.trxcntl ) {
int mstat = TIOCM_RTS;
Expand All @@ -482,9 +482,9 @@ tty_set_rts(int fd)
}
}

/* Set RTS line to passive state */
/* Set tty device into receive mode */
void
tty_clr_rts(int fd)
tty_set_rx(int fd)
{
if ( TRX_RTS_1 == cfg.trxcntl ) {
int mstat = TIOCM_RTS;
Expand Down
4 changes: 2 additions & 2 deletions src/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ int tty_set_attr(ttydata_t *mod);
speed_t tty_transpeed(int speed);
int tty_cooked(ttydata_t *mod);
int tty_close(ttydata_t *mod);
void tty_set_rts(int fd);
void tty_clr_rts(int fd);
void tty_set_tx(int fd);
void tty_set_rx(int fd);
void tty_delay(int usec);

#endif /* _TTY_H */

0 comments on commit 68f9880

Please sign in to comment.