Skip to content

Commit 751367d

Browse files
committed
Use primary/secondary terminology in scripts
1 parent 4ba1ebc commit 751367d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

extmod/machine_i2c.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int mp_machine_soft_i2c_writeto(mp_obj_base_t *self_in, uint16_t addr, const uin
193193
return ret;
194194
}
195195

196-
// write the slave address
196+
// write the secondary address
197197
ret = mp_hal_i2c_write_byte(self, addr << 1);
198198
if (ret < 0) {
199199
return ret;
@@ -239,7 +239,7 @@ int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t
239239
return ret;
240240
}
241241

242-
// write the slave address
242+
// write the secondary address
243243
ret = mp_hal_i2c_write_byte(self, (addr << 1) | 1);
244244
if (ret < 0) {
245245
return ret;
@@ -249,7 +249,7 @@ int mp_machine_soft_i2c_readfrom(mp_obj_base_t *self_in, uint16_t addr, uint8_t
249249
return -MP_ENODEV;
250250
}
251251

252-
// read the bytes from the slave
252+
// read the bytes from the secondary
253253
while (len--) {
254254
ret = mp_hal_i2c_read_byte(self, dest++, len == 0);
255255
if (ret != 0) {

tests/run-tests

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,28 @@ def run_micropython(pyb, args, test_file, is_special=False):
8787
def get(required=False):
8888
rv = b''
8989
while True:
90-
ready = select.select([master], [], [], 0.02)
91-
if ready[0] == [master]:
92-
rv += os.read(master, 1024)
90+
ready = select.select([primary], [], [], 0.02)
91+
if ready[0] == [primary]:
92+
rv += os.read(primary, 1024)
9393
else:
9494
if not required or rv:
9595
return rv
9696

9797
def send_get(what):
98-
os.write(master, what)
98+
os.write(primary, what)
9999
return get()
100100

101101
with open(test_file, 'rb') as f:
102102
# instead of: output_mupy = subprocess.check_output(args, stdin=f)
103-
master, slave = pty.openpty()
104-
p = subprocess.Popen(args, stdin=slave, stdout=slave,
103+
primary, secondary = pty.openpty()
104+
p = subprocess.Popen(args, stdin=secondary, stdout=secondary,
105105
stderr=subprocess.STDOUT, bufsize=0)
106106
banner = get(True)
107107
output_mupy = banner + b''.join(send_get(line) for line in f)
108108
send_get(b'\x04') # exit the REPL, so coverage info is saved
109109
p.kill()
110-
os.close(master)
111-
os.close(slave)
110+
os.close(primary)
111+
os.close(secondary)
112112
else:
113113
output_mupy = subprocess.check_output(args + [test_file], stderr=subprocess.STDOUT)
114114
except subprocess.CalledProcessError:

tools/pyboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def inWaiting(self):
191191

192192

193193
class ProcessPtyToTerminal:
194-
"""Execute a process which creates a PTY and prints slave PTY as
194+
"""Execute a process which creates a PTY and prints secondary PTY as
195195
first line of its output, and emulate serial connection using
196196
this PTY."""
197197

0 commit comments

Comments
 (0)