File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
hal/tests/TESTS/pin_names/arduino_uno Expand file tree Collapse file tree 1 file changed +9
-1
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
You can’t perform that action at this time.
0 commit comments