Skip to content

Commit dc64563

Browse files
authored
feat: Changes CI [HardwareSerial]
[HardwareSerial]: Changes CI to match new HardwareSerial begin() and end()
1 parent c9388a6 commit dc64563

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

tests/uart/uart.ino

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ void start_serial(unsigned long baudrate = 115200) {
7878
// This function stops all the available test UARTs
7979
void stop_serial(bool hard_stop = false) {
8080
#if SOC_UART_NUM >= 2
81-
Serial1.end(hard_stop);
81+
Serial1.end(/*hard_stop*/);
8282
#endif
8383

8484
#if SOC_UART_NUM >= 3
85-
Serial2.end(hard_stop);
85+
Serial2.end(/*hard_stop*/);
8686
#endif
8787
}
8888

@@ -139,6 +139,19 @@ void task_delayed_msg(void *pvParameters) {
139139
// This function is automatically called by unity before each test is run
140140
void setUp(void) {
141141
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
142155
}
143156

144157
// This function is automatically called by unity after each test is run
@@ -393,7 +406,7 @@ void disabled_uart_calls_test(void) {
393406

394407
// This test checks if the pins can be changed and if the message can be transmitted and received correctly after the change
395408
void change_pins_test(void) {
396-
stop_serial();
409+
//stop_serial();
397410

398411
log_d("Disabling UART loopback");
399412

0 commit comments

Comments
 (0)