From d4d0b5501bbf21f11d34a7f6bfbc7e946aedc6b2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 19 Sep 2020 10:35:38 -0700 Subject: [PATCH] [wpilib] Use more inclusive terminology (NFC) (#2723) --- wpilibc/src/main/native/include/frc/SPI.h | 4 ++-- .../main/java/edu/wpi/first/wpilibj/SPI.java | 10 ++++----- .../src/main/native/libuv/src/unix/tty.cpp | 21 ++++++++++--------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/SPI.h b/wpilibc/src/main/native/include/frc/SPI.h index e9cbe627fe..3592775902 100644 --- a/wpilibc/src/main/native/include/frc/SPI.h +++ b/wpilibc/src/main/native/include/frc/SPI.h @@ -122,11 +122,11 @@ class SPI : public ErrorBase { void SetChipSelectActiveLow(); /** - * Write data to the slave device. Blocks until there is space in the + * Write data to the peripheral device. Blocks until there is space in the * output FIFO. * * If not running in output only mode, also saves the data received - * on the MISO input during the transfer into the receive FIFO. + * on the CIPO input during the transfer into the receive FIFO. */ virtual int Write(uint8_t* data, int size); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java index aca2cbeacf..9dcdc65ceb 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2016-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -162,9 +162,9 @@ public class SPI implements AutoCloseable { } /** - * Write data to the slave device. Blocks until there is space in the output FIFO. + * Write data to the peripheral device. Blocks until there is space in the output FIFO. * - *

If not running in output only mode, also saves the data received on the MISO input during + *

If not running in output only mode, also saves the data received on the CIPO input during * the transfer into the receive FIFO. */ public int write(byte[] dataToSend, int size) { @@ -175,9 +175,9 @@ public class SPI implements AutoCloseable { } /** - * Write data to the slave device. Blocks until there is space in the output FIFO. + * Write data to the peripheral device. Blocks until there is space in the output FIFO. * - *

If not running in output only mode, also saves the data received on the MISO input during + *

If not running in output only mode, also saves the data received on the CIPO input during * the transfer into the receive FIFO. * * @param dataToSend The buffer containing the data to send. diff --git a/wpiutil/src/main/native/libuv/src/unix/tty.cpp b/wpiutil/src/main/native/libuv/src/unix/tty.cpp index 74d3d75d76..5f681406b9 100644 --- a/wpiutil/src/main/native/libuv/src/unix/tty.cpp +++ b/wpiutil/src/main/native/libuv/src/unix/tty.cpp @@ -38,7 +38,7 @@ static int orig_termios_fd = -1; static struct termios orig_termios; static uv_spinlock_t termios_spinlock = UV_SPINLOCK_INITIALIZER; -static int uv__tty_is_slave(const int fd) { +static int uv__tty_is_peripheral(const int fd) { int result; #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) int dummy; @@ -50,15 +50,16 @@ static int uv__tty_is_slave(const int fd) { result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0; #elif defined(__NetBSD__) /* - * NetBSD as an extension returns with ptsname(3) and ptsname_r(3) the slave - * device name for both descriptors, the master one and slave one. + * NetBSD as an extension returns with ptsname(3) and ptsname_r(3) the + * peripheral device name for both descriptors, the controller one and + * peripheral one. * * Implement function to compare major device number with pts devices. * * The major numbers are machine-dependent, on NetBSD/amd64 they are * respectively: - * - master tty: ptc - major 6 - * - slave tty: pts - major 5 + * - controller tty: ptc - major 6 + * - peripheral tty: pts - major 5 */ struct stat sb; @@ -133,12 +134,12 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int unused) { * other processes. */ if (type == UV_TTY) { - /* Reopening a pty in master mode won't work either because the reopened - * pty will be in slave mode (*BSD) or reopening will allocate a new - * master/slave pair (Linux). Therefore check if the fd points to a - * slave device. + /* Reopening a pty in controller mode won't work either because the reopened + * pty will be in peripheral mode (*BSD) or reopening will allocate a new + * controller/peripheral pair (Linux). Therefore check if the fd points to a + * peripheral device. */ - if (uv__tty_is_slave(fd) && ttyname_r(fd, path, sizeof(path)) == 0) + if (uv__tty_is_peripheral(fd) && ttyname_r(fd, path, sizeof(path)) == 0) r = uv__open_cloexec(path, mode); else r = -1;