Skip to content

Commit 6b65310

Browse files
Merge 98dc82c into fa6430c
2 parents fa6430c + 98dc82c commit 6b65310

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

changelog.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
<!-- ## [Unreleased] -->
1616

1717
## Released
18+
## [2.3.5] - 2023-05-05
19+
### Fixed
20+
- Use `ticks_diff` to get correct time to lower control pin after sending the frame, see #72
21+
1822
## [2.3.4] - 2023-03-20
1923
### Added
2024
- `package.json` for `mip` installation with MicroPython v1.19.1 or newer
@@ -282,8 +286,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
282286
- PEP8 style issues on all files of [`lib/uModbus`](lib/uModbus)
283287

284288
<!-- Links -->
285-
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.3.4...develop
289+
[Unreleased]: https://github.com/brainelectronics/micropython-modbus/compare/2.3.5...develop
286290

291+
[2.3.4]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.4
287292
[2.3.4]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.4
288293
[2.3.3]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.3
289294
[2.3.2]: https://github.com/brainelectronics/micropython-modbus/tree/2.3.2

umodbus/serial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _send(self, modbus_pdu: bytes, slave_addr: int) -> None:
258258

259259
if self._ctrlPin:
260260
total_frame_time_us = self._t1char * len(serial_pdu)
261-
while time.ticks_us() <= send_start_time + total_frame_time_us:
261+
while time.ticks_diff(time.ticks_us(), send_start_time) < total_frame_time_us:
262262
machine.idle()
263263
self._ctrlPin(0)
264264

0 commit comments

Comments
 (0)