Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion hal/tests/TESTS/pin_names/arduino_uno/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ void UART_test()
{
utest_printf("UART TX Pin 0x%x RX Pin 0x%x\n", TX_pin, RX_pin);

// 1. check if Arduino_uno pins are not already used by the console
TEST_SKIP_UNLESS_MESSAGE(TX_pin != CONSOLE_TX, "ARDUINO_UNO_UART pin shared with CONSOLE_TX");
TEST_SKIP_UNLESS_MESSAGE(RX_pin != CONSOLE_RX, "ARDUINO_UNO_UART pin shared with CONSOLE_RX");

// 2. check if Arduino_uno pins are part of pinmap table
{
const PinMap *maps = serial_tx_pinmap();
while (maps->pin != (PinName)NC) { // check each pin from PinMap table till NC pin
Expand All @@ -151,8 +153,14 @@ void UART_test()
TEST_ASSERT_NOT_EQUAL(NC, maps->pin);
}

// 3. check if Arduino_uno pins are not using the same UART instance as console
int console_uart = pinmap_peripheral(CONSOLE_TX, serial_tx_pinmap());
TEST_ASSERT_NOT_EQUAL(console_uart, pinmap_peripheral(TX_pin, serial_tx_pinmap()));

// 4. check if UART pins can be initialized
BufferedSerial TEST(TX_pin, RX_pin);
// Basic API call

// 5. check a basic API call
TEST.set_baud(115200);
}

Expand Down
4 changes: 3 additions & 1 deletion hal/tests/TESTS/pin_names/generic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Requirements specified in docs/design-documents/hal/0004-pin-names-general-guide

#ifndef LED1
#error [NOT_SUPPORTED] Target is not following mbed-os pin names standard // Test is set as Skipped
// #error [NOT_SUPPORTED] Target is not following mbed-os pin names standard // Test is set as Error
#else

using namespace utest::v1;
Expand Down Expand Up @@ -82,6 +81,9 @@ Case cases[] = {
#ifdef BUTTON2
Case("BUTTON2", BUTTON_test<2, BUTTON2>),
#endif
#ifdef BUTTON3
Case("BUTTON3", BUTTON_test<3, BUTTON3>),
#endif
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down