1
0
Fork 0
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:
Petr Ledvina 2024-12-20 19:01:00 +01:00 committed by GitHub
parent 7dec49ce42
commit 2f21754a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 120 additions and 37 deletions

View file

@ -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;
}