Provide pinmap_uart_restricted_peripherals() function under DEVICE_SERIAL

pull/12379/head
Przemyslaw Stekiel 2020-02-10 08:17:55 +01:00
parent 3c0982d939
commit 0d9a54f92e
3 changed files with 6 additions and 0 deletions

View File

@ -136,6 +136,7 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> &not_mat
}
}
#if DEVICE_SERIAL
if (!strcmp(PortType::PinMap::name, UART_NAME) || !strcmp(PortType::PinMap::name, UARTNOFC_NAME)) {
if (pinmap_list_has_peripheral(pinmap_uart_restricted_peripherals(), port.peripheral)) {
utest_printf("Skipping %s peripheral %i with pin %s (%i)\r\n", pin_type,
@ -143,6 +144,7 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> &not_mat
continue;
}
}
#endif
// skipp pin searching if single pin port type
if (PortType::pin_count > 1) {

View File

@ -90,6 +90,7 @@ MBED_WEAK const PinList *pinmap_gpio_restricted_pins()
}
//*** Default restricted peripherals ***
#if DEVICE_SERIAL
MBED_WEAK const PeripheralList *pinmap_uart_restricted_peripherals()
{
static const int stdio_uart = pinmap_peripheral(STDIO_UART_TX, serial_tx_pinmap());
@ -104,3 +105,4 @@ MBED_WEAK const PeripheralList *pinmap_uart_restricted_peripherals()
};
return &peripheral_list;
}
#endif

View File

@ -174,7 +174,9 @@ const PinList *pinmap_restricted_pins(void);
*
* @return Pointer to a peripheral list of peripheral to avoid
*/
#if DEVICE_SERIAL
const PeripheralList *pinmap_uart_restricted_peripherals(void);
#endif
/**
* Get the pin list of pins to avoid during GPIO/GPIO_IRQ testing