@@ -224,25 +224,6 @@ inline void SoftwareSerial::handle_interrupt()
224224 }
225225}
226226
227- #if defined(PCINT0_vect)
228- ISR (PCINT0_vect)
229- {
230- SoftwareSerial::handle_interrupt ();
231- }
232- #endif
233-
234- #if defined(PCINT1_vect)
235- ISR (PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
236- #endif
237-
238- #if defined(PCINT2_vect)
239- ISR (PCINT2_vect, ISR_ALIASOF(PCINT0_vect));
240- #endif
241-
242- #if defined(PCINT3_vect)
243- ISR (PCINT3_vect, ISR_ALIASOF(PCINT0_vect));
244- #endif
245-
246227//
247228// Constructor
248229//
@@ -316,7 +297,7 @@ void SoftwareSerial::begin(long speed)
316297 _tx_delay = subtract_cap (bit_delay, 15 / 4 );
317298
318299 // Only setup rx when we have a valid PCINT for this pin
319- if (digitalPinToPCICR (_receivePin) ) {
300+ if (1 ) {
320301 #if GCC_VERSION > 40800
321302 // Timings counted from gcc 4.8.2 output. This works up to 115200 on
322303 // 16Mhz and 57600 on 8Mhz.
@@ -353,15 +334,7 @@ void SoftwareSerial::begin(long speed)
353334 _rx_delay_stopbit = subtract_cap (bit_delay * 3 / 4 , (44 + 17 ) / 4 );
354335 #endif
355336
356-
357- // Enable the PCINT for the entire port here, but never disable it
358- // (others might also need it, so we disable the interrupt by using
359- // the per-pin PCMSK register).
360- *digitalPinToPCICR (_receivePin) |= _BV (digitalPinToPCICRbit (_receivePin));
361- // Precalculate the pcint mask register and value, so setRxIntMask
362- // can be used inside the ISR without costing too much time.
363- _pcint_maskreg = digitalPinToPCMSK (_receivePin);
364- _pcint_maskvalue = _BV (digitalPinToPCMSKbit (_receivePin));
337+ attachInterrupt (_receivePin, SoftwareSerial::handle_interrupt, CHANGE);
365338
366339 tunedDelay (_tx_delay); // if we were low this establishes the end
367340 }
0 commit comments