mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Improve serial_post.h (#14096)
This commit is contained in:
parent
7dec49ce42
commit
2f21754a69
7 changed files with 120 additions and 37 deletions
|
@ -197,8 +197,8 @@ static void resetBuffers(softSerial_t *softSerial)
|
|||
|
||||
softSerial_t* softSerialFromIdentifier(serialPortIdentifier_e identifier)
|
||||
{
|
||||
if (identifier >= SERIAL_PORT_SOFTSERIAL1 && identifier < SERIAL_PORT_SOFTSERIAL1 + SERIAL_SOFTSERIAL_COUNT) {
|
||||
return &softSerialPorts[identifier - SERIAL_PORT_SOFTSERIAL1];
|
||||
if (identifier >= SERIAL_PORT_SOFTSERIAL_FIRST && identifier < SERIAL_PORT_SOFTSERIAL_FIRST + SERIAL_SOFTSERIAL_COUNT) {
|
||||
return &softSerialPorts[identifier - SERIAL_PORT_SOFTSERIAL_FIRST];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue