Skip to content

Commit

Permalink
Mixed signed/unsigned division bug. Fixes #227
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Nov 23, 2021
1 parent cff4deb commit b1aae5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EspSoftwareSerial",
"version": "6.15.1",
"version": "6.15.2",
"description": "Implementation of the Arduino software serial for ESP8266/ESP32.",
"keywords": [
"serial", "io", "softwareserial"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EspSoftwareSerial
version=6.15.1
version=6.15.2
author=Dirk Kaar, Peter Lerup
maintainer=Dirk Kaar <[email protected]>
sentence=Implementation of the Arduino software serial for ESP8266/ESP32.
Expand Down
2 changes: 1 addition & 1 deletion src/SoftwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void IRAM_ATTR SoftwareSerial::preciseDelay(bool sync) {
if (!m_intTxEnabled) { xt_wsr_ps(m_savedPS); }
const auto expired = ESP.getCycleCount() - m_periodStart;
const int32_t remaining = m_periodDuration - expired;
const int32_t ms = remaining / 1000L / ESP.getCpuFreqMHz();
const int32_t ms = remaining / 1000L / static_cast<int32_t>(ESP.getCpuFreqMHz());
if (ms > 0)
{
delay(ms);
Expand Down

0 comments on commit b1aae5c

Please sign in to comment.