Skip to content

Commit 448854c

Browse files
committed
Return error-code for failing interface
Rather than returning the error code for UART1 regardless of which interface had problems, we should return the error code for the interface that actually had an error. Pretty sure this was a simple copy-paste mistake.
1 parent 7affea7 commit 448854c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/c_uart.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ BBIO_err uart_cleanup(void)
4646
if (e1 != BBIO_OK)
4747
return e1;
4848
if (e2 != BBIO_OK)
49-
return e1;
49+
return e2;
5050
if (e3 != BBIO_OK)
51-
return e1;
51+
return e3;
5252
if (e4 != BBIO_OK)
53-
return e1;
53+
return e4;
5454
if (e5 != BBIO_OK)
55-
return e1;
55+
return e5;
5656

5757
return BBIO_OK;
5858
}

0 commit comments

Comments
 (0)