Skip to content

Commit

Permalink
Provide pinmap_uart_restricted_peripherals() function under DEVICE_SE…
Browse files Browse the repository at this point in the history
…RIAL
  • Loading branch information
mprse committed Feb 10, 2020
1 parent 3c0982d commit 0d9a54f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ 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,
port.peripheral, FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
continue;
}
}
#endif

// skipp pin searching if single pin port type
if (PortType::pin_count > 1) {
Expand Down
2 changes: 2 additions & 0 deletions hal/mbed_pinmap_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -104,3 +105,4 @@ MBED_WEAK const PeripheralList *pinmap_uart_restricted_peripherals()
};
return &peripheral_list;
}
#endif
2 changes: 2 additions & 0 deletions hal/pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d9a54f

Please sign in to comment.