@@ -78,11 +78,11 @@ void start_serial(unsigned long baudrate = 115200) {
78
78
// This function stops all the available test UARTs
79
79
void stop_serial (bool hard_stop = false ) {
80
80
#if SOC_UART_NUM >= 2
81
- Serial1.end (hard_stop);
81
+ Serial1.end (/* hard_stop*/ );
82
82
#endif
83
83
84
84
#if SOC_UART_NUM >= 3
85
- Serial2.end (hard_stop);
85
+ Serial2.end (/* hard_stop*/ );
86
86
#endif
87
87
}
88
88
@@ -139,6 +139,19 @@ void task_delayed_msg(void *pvParameters) {
139
139
// This function is automatically called by unity before each test is run
140
140
void setUp (void ) {
141
141
start_serial (115200 );
142
+ #if SOC_UART_NUM == 2
143
+ log_d (" Setup internal loop-back from and back to Serial1 (UART1) TX >> Serial1 (UART1) RX" );
144
+
145
+ Serial1.onReceive ([]() {onReceive_cb (Serial1);});
146
+ uart_internal_loopback (1 , RX1);
147
+ #elif SOC_UART_NUM == 3
148
+ log_d (" Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)" );
149
+
150
+ Serial1.onReceive ([]() {onReceive_cb (Serial1);});
151
+ Serial2.onReceive ([]() {onReceive_cb (Serial2);});
152
+ uart_internal_loopback (1 , RX2);
153
+ uart_internal_loopback (2 , RX1);
154
+ #endif
142
155
}
143
156
144
157
// This function is automatically called by unity after each test is run
@@ -393,7 +406,7 @@ void disabled_uart_calls_test(void) {
393
406
394
407
// This test checks if the pins can be changed and if the message can be transmitted and received correctly after the change
395
408
void change_pins_test (void ) {
396
- stop_serial ();
409
+ // stop_serial();
397
410
398
411
log_d (" Disabling UART loopback" );
399
412
0 commit comments