Skip to content

Commit e715ebf

Browse files
committed
Cast pins to signed integers to avoid Wtype-limits compile warning
1 parent 7a2e1cd commit e715ebf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/SoftwareSerial/src/SoftwareSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void SoftwareSerial::begin(long speed)
316316
_tx_delay = subtract_cap(bit_delay, 15 / 4);
317317

318318
// Only setup rx when we have a valid PCINT for this pin
319-
if (digitalPinToPCICR(_receivePin)) {
319+
if (digitalPinToPCICR((int8_t)_receivePin)) {
320320
#if GCC_VERSION > 40800
321321
// Timings counted from gcc 4.8.2 output. This works up to 115200 on
322322
// 16Mhz and 57600 on 8Mhz.
@@ -357,7 +357,7 @@ void SoftwareSerial::begin(long speed)
357357
// Enable the PCINT for the entire port here, but never disable it
358358
// (others might also need it, so we disable the interrupt by using
359359
// the per-pin PCMSK register).
360-
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
360+
*digitalPinToPCICR((int8_t)_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
361361
// Precalculate the pcint mask register and value, so setRxIntMask
362362
// can be used inside the ISR without costing too much time.
363363
_pcint_maskreg = digitalPinToPCMSK(_receivePin);

0 commit comments

Comments
 (0)