Skip to content

Commit

Permalink
minor review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jun 17, 2024
1 parent a573fdf commit fccdb4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions circuitpython_nrf24l01/network/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,8 @@ def _write_to_pipe(self, to_node: int, to_pipe: int, is_multicast: bool) -> bool
result = self._tx_standby(self.tx_timeout)
else:
# break message into fragments and send the multiple resulting frames
total = bool(len(self.frame_buf.message) % MAX_FRAG_SIZE) + int(
len(self.frame_buf.message) / MAX_FRAG_SIZE
)
msg_len = len(self.frame_buf.message)
total = bool(msg_len % MAX_FRAG_SIZE) + int(msg_len / MAX_FRAG_SIZE)
msg_t = self.frame_buf.header.message_type
for count in range(total):
buf_start = count * MAX_FRAG_SIZE
Expand Down
4 changes: 2 additions & 2 deletions circuitpython_nrf24l01/rf24.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ def send(
self._ce_pin.value = False
if isinstance(buf, (list, tuple)):
result = []
for byte in buf:
result.append(self.send(byte, ask_no_ack, force_retry, send_only))
for b_array in buf:
result.append(self.send(b_array, ask_no_ack, force_retry, send_only))

Check warning on line 323 in circuitpython_nrf24l01/rf24.py

View check run for this annotation

Codecov / codecov/patch

circuitpython_nrf24l01/rf24.py#L322-L323

Added lines #L322 - L323 were not covered by tests
return result # type: ignore[return-value]
if self._in[0] & 0x10 or self._in[0] & 1:
self.flush_tx()
Expand Down

0 comments on commit fccdb4e

Please sign in to comment.