aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Entinger <consulting@lxrobotics.com>2019-09-16 12:04:55 +0200
committerGitHub <noreply@github.com>2019-09-16 12:04:55 +0200
commitffeca151f1eda674b7baf93b91a827f70c9d836f (patch)
treee60e2eaa3822ba3298b09c5d6383449ee406ab84
parentcc8daac45ed0b15896101b691865039c155693bb (diff)
parentc270eaabf4b7e85b0cfbb96c57817af5995b5ad8 (diff)
Merge pull request #95 from jrowberg/master
Cast pins to signed integers to avoid Wtype-limits compile warning
-rw-r--r--cores/arduino/WString.cpp2
-rw-r--r--libraries/SoftwareSerial/src/SoftwareSerial.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp
index f2572d6..043fda7 100644
--- a/cores/arduino/WString.cpp
+++ b/cores/arduino/WString.cpp
@@ -121,7 +121,7 @@ String::String(double value, unsigned char decimalPlaces)
String::~String()
{
- free(buffer);
+ if (buffer) free(buffer);
}
/*********************************************/
diff --git a/libraries/SoftwareSerial/src/SoftwareSerial.cpp b/libraries/SoftwareSerial/src/SoftwareSerial.cpp
index 474fe4a..3163d7a 100644
--- a/libraries/SoftwareSerial/src/SoftwareSerial.cpp
+++ b/libraries/SoftwareSerial/src/SoftwareSerial.cpp
@@ -316,7 +316,7 @@ void SoftwareSerial::begin(long speed)
_tx_delay = subtract_cap(bit_delay, 15 / 4);
// Only setup rx when we have a valid PCINT for this pin
- if (digitalPinToPCICR(_receivePin)) {
+ if (digitalPinToPCICR((int8_t)_receivePin)) {
#if GCC_VERSION > 40800
// Timings counted from gcc 4.8.2 output. This works up to 115200 on
// 16Mhz and 57600 on 8Mhz.
@@ -357,7 +357,7 @@ void SoftwareSerial::begin(long speed)
// Enable the PCINT for the entire port here, but never disable it
// (others might also need it, so we disable the interrupt by using
// the per-pin PCMSK register).
- *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
+ *digitalPinToPCICR((int8_t)_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
// Precalculate the pcint mask register and value, so setRxIntMask
// can be used inside the ISR without costing too much time.
_pcint_maskreg = digitalPinToPCMSK(_receivePin);