1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Removed debugging helpers.

This commit is contained in:
Nick Patavalis
2015-08-19 09:38:56 +03:00
parent e709254a9b
commit 2741018a66
2 changed files with 18 additions and 31 deletions

View File

@ -207,30 +207,12 @@ cf2setispeed_custom(struct termios *tios, int speed)
return 0;
}
/* Helpers for debugging */
/***************************************************************************/
void
cf2showspeed(struct termios *tios)
{
printf("CB: %08o, CIB: %08o, ospeed = %d, ispeed = %d\r\n",
tios->c_cflag & (CBAUD | CBAUDEX),
(tios->c_cflag >> IBSHIFT) & (CBAUD | CBAUDEX),
tios->c_ospeed,
tios->c_ispeed);
}
void
tc2showspeed(int fd)
{
struct termios tios;
int r;
r = tc2getattr(fd, &tios);
if (r < 0) {
printf("%d: Failed to get attrs: %s", fd, strerror(errno));
return;
}
printf("%d: ", fd);
cf2showspeed(&tios);
}
/*
* Local Variables:
* mode:c
* tab-width: 4
* c-basic-offset: 4
* End:
*/

View File

@ -55,11 +55,16 @@ speed_t cf2getispeed(struct termios *tios);
int cf2setispeed_custom(struct termios *tios, int speed);
int cf2setospeed_custom(struct termios *tios, int speed);
/* Helpers for debugging */
void cf2showspeed(struct termios *tios);
void tc2showspeed(int fd) ;
/***************************************************************************/
#endif /* of TERMIOS2_H */
/***************************************************************************/
/*
* Local Variables:
* mode:c
* tab-width: 4
* c-basic-offset: 4
* End:
*/