1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Added abillity to specify USART6 as default port.

This fixes the mismatch between identifier and index when uarts are actually missing and not defined.
This commit is contained in:
blckmn 2016-11-11 17:19:43 +11:00
parent e82e4465f1
commit 0ebaef175e
4 changed files with 19 additions and 3 deletions

View file

@ -107,6 +107,17 @@ baudRate_e lookupBaudRateIndex(uint32_t baudRate)
return BAUD_AUTO;
}
int findSerialPortIndexByIdentifier(serialPortIdentifier_e identifier)
{
for (int index = 0; index < SERIAL_PORT_COUNT; index++) {
const serialPortUsage_t *candidate = &serialPortUsageList[index];
if (candidate->identifier == identifier) {
return index;
}
}
return -1;
}
serialPortUsage_t *findSerialPortUsageByIdentifier(serialPortIdentifier_e identifier)
{
uint8_t index;