HardwareSerial: fix begin() lock issue on error path (#8182)

* HardwareSerial: fix begin() lock issue on error path

If the user supplied a wrong UART number, the begin() method would
return without releasing the lock. Add missing unlock call.

* removing unsed Case test

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
This commit is contained in:
Luca Burelli 2023-05-11 15:13:36 +02:00 committed by GitHub
parent a2c892073b
commit 3ec5f4efa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,9 +365,6 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
}
break;
#endif
default:
log_e("Bad UART Number");
return;
}
}