but, if _receivePin is 2 (PB2), using CHANGE as mode, the interrupt will be generated for RISING edges only and reception will not work for normal logic.
I have changed the code as follows:
Thanks for pointing this out! I'll fix this soon.
BTW this also applies for ATmega8515, ATmega162, ATmega8535 and ATmega16. ATmega162 also has PCINTs, so we can't just check for INT_ONLY.
ATMega32 does not have CHANGE interrupts on pin PB2 (INT2). Only RISING and FALLING are valid for that pin.
At method SoftSerial::begin() (file SoftSerial.cpp), the interrupt for reception is set as follows:
but, if _receivePin is 2 (PB2), using CHANGE as mode, the interrupt will be generated for RISING edges only and reception will not work for normal logic. I have changed the code as follows:
Now, it works for PB2 as _receivePin on ATMega32. I have not tested this change with other pins and other microcontrollers.