platforms: nuttx: SerialImpl: fix hang if baudrate is 0 (#23238)

This commit is contained in:
Jacob Dahl 2024-06-07 20:08:21 -08:00 committed by GitHub
parent 5c64a3ed93
commit 2882e5c4e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,6 +74,11 @@ bool SerialImpl::configure()
int speed;
switch (_baudrate) {
case 0:
// special case, if baudrate is 0 it hangs entire system
PX4_ERR("baudrate not specified");
return false;
case 9600: speed = B9600; break;
case 19200: speed = B19200; break;