Skip to content

Commit f078662

Browse files
authored
fix(uart): new testing loopback API
Update uart.ino to use newuart loopback API
1 parent 7176970 commit f078662

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/validation/uart/uart.ino

+13-13
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void setUp(void) {
149149
Serial1.onReceive([]() {
150150
onReceive_cb(Serial1);
151151
});
152-
uart_internal_loopback(1, RX1);
152+
uart_internal_loopback(1, true);
153153
#elif SOC_UART_NUM == 3
154154
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
155155

@@ -159,8 +159,8 @@ void setUp(void) {
159159
Serial2.onReceive([]() {
160160
onReceive_cb(Serial2);
161161
});
162-
uart_internal_loopback(1, RX2);
163-
uart_internal_loopback(2, RX1);
162+
uart_internal_loopback(1, true); // it was suppose to cross connect TX1 to RX2!
163+
uart_internal_loopback(2, true); // it was suppose to cross connect TX2 to RX1!
164164
#endif
165165
}
166166

@@ -446,10 +446,10 @@ void change_pins_test(void) {
446446
log_d("Re-enabling UART loopback");
447447

448448
#if SOC_UART_NUM == 2
449-
uart_internal_loopback(1, NEW_RX1);
449+
uart_internal_loopback(1, true);
450450
#elif SOC_UART_NUM == 3
451-
uart_internal_loopback(1, RX1);
452-
uart_internal_loopback(2, RX2);
451+
uart_internal_loopback(1, true);
452+
uart_internal_loopback(2, true);
453453
#endif
454454

455455
transmit_and_check_msg("using new pins");
@@ -469,7 +469,7 @@ void auto_baudrate_test(void) {
469469

470470
#if SOC_UART_NUM == 2
471471
selected_serial = &Serial1;
472-
uart_internal_loopback(0, RX1);
472+
uart_internal_loopback(0, RX1); // it was suppose to cross connect TX0 to RX1
473473
#elif SOC_UART_NUM == 3
474474
selected_serial = &Serial2;
475475
#endif
@@ -520,10 +520,10 @@ void periman_test(void) {
520520

521521
#if SOC_UART_NUM == 3
522522
Serial2.setPins(RX2, TX2);
523-
uart_internal_loopback(1, RX2);
524-
uart_internal_loopback(2, RX1);
523+
uart_internal_loopback(1, true); // it was suppose to cross connect TX2 to RX1
524+
uart_internal_loopback(2, true); // it was suppose to cross connect TX1 to RX2
525525
#elif SOC_UART_NUM == 2
526-
uart_internal_loopback(1, RX1);
526+
uart_internal_loopback(1, true);
527527
#endif
528528

529529
log_d("Trying to send message using UART with I2C disabled");
@@ -576,7 +576,7 @@ void setup() {
576576
Serial1.onReceive([]() {
577577
onReceive_cb(Serial1);
578578
});
579-
uart_internal_loopback(1, RX1);
579+
uart_internal_loopback(1, true);
580580
#elif SOC_UART_NUM == 3
581581
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
582582

@@ -586,8 +586,8 @@ void setup() {
586586
Serial2.onReceive([]() {
587587
onReceive_cb(Serial2);
588588
});
589-
uart_internal_loopback(1, RX2);
590-
uart_internal_loopback(2, RX1);
589+
uart_internal_loopback(1, true); // it was suppose to cross connect TX2 to RX1
590+
uart_internal_loopback(2, true); // it was suppose to cross connect TX1 to RX2
591591
#endif
592592

593593
log_d("Setup done. Starting tests");

0 commit comments

Comments
 (0)