File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
hal/tests/TESTS/pin_names Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -124,9 +124,11 @@ void UART_test()
124
124
{
125
125
utest_printf (" UART TX Pin 0x%x RX Pin 0x%x\n " , TX_pin, RX_pin);
126
126
127
+ // 1. check if Arduino_uno pins are not already used by the console
127
128
TEST_SKIP_UNLESS_MESSAGE (TX_pin != CONSOLE_TX, " ARDUINO_UNO_UART pin shared with CONSOLE_TX" );
128
129
TEST_SKIP_UNLESS_MESSAGE (RX_pin != CONSOLE_RX, " ARDUINO_UNO_UART pin shared with CONSOLE_RX" );
129
130
131
+ // 2. check if Arduino_uno pins are part of pinmap table
130
132
{
131
133
const PinMap *maps = serial_tx_pinmap ();
132
134
while (maps->pin != (PinName)NC) { // check each pin from PinMap table till NC pin
@@ -151,8 +153,14 @@ void UART_test()
151
153
TEST_ASSERT_NOT_EQUAL (NC, maps->pin );
152
154
}
153
155
156
+ // 3. check if Arduino_uno pins are not using the same UART instance as console
157
+ int console_uart = pinmap_peripheral (CONSOLE_TX, serial_tx_pinmap ());
158
+ TEST_ASSERT_NOT_EQUAL (console_uart, pinmap_peripheral (TX_pin, serial_tx_pinmap ()));
159
+
160
+ // 4. check if UART pins can be initialized
154
161
BufferedSerial TEST (TX_pin, RX_pin);
155
- // Basic API call
162
+
163
+ // 5. check a basic API call
156
164
TEST.set_baud (115200 );
157
165
}
158
166
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ Requirements specified in docs/design-documents/hal/0004-pin-names-general-guide
26
26
27
27
#ifndef LED1
28
28
#error [NOT_SUPPORTED] Target is not following mbed-os pin names standard // Test is set as Skipped
29
- // #error [NOT_SUPPORTED] Target is not following mbed-os pin names standard // Test is set as Error
30
29
#else
31
30
32
31
using namespace utest ::v1;
@@ -82,6 +81,9 @@ Case cases[] = {
82
81
#ifdef BUTTON2
83
82
Case (" BUTTON2" , BUTTON_test<2 , BUTTON2>),
84
83
#endif
84
+ #ifdef BUTTON3
85
+ Case (" BUTTON3" , BUTTON_test<3 , BUTTON3>),
86
+ #endif
85
87
};
86
88
87
89
utest::v1::status_t greentea_test_setup (const size_t number_of_cases)
You can’t perform that action at this time.
0 commit comments