Add the following statement to the function **int sx126x::endPacket()** just after `setPacketParams(_preambleLength, _implicitHeaderMode, _payloadLength, _crcMode);`:
// Added by Mees Electronics: RXEN on E22 module back to low
The E22 module has an RXEN and a TXEN input. Both must be used and both cannot be logic 1 at the same time. RXEN must be controlled by the firmware while TXEN can be controlled by either the firmware or the DIO2 pin, by using the DIO2_AS_RF_SWITCH function in the firmware. My current solution is to control TXEN by the DIO2 pin. If you forget to control the TXEN line, the maximum output will be 22 dBm instead of 33 dBm. It would be better to alter the code to make it more universal (like with the *sx128x* code), but for now it works.