8000 Diverse changes to uos.stat() and UART modules · daq-tools/pycom-micropython@3349256 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3349256

Browse files
robert-hhamotl
authored andcommitted
Diverse changes to uos.stat() and UART modules
- Use long int for time stamps in uos.stat() because of short int overflow - Simplify display of the UART config
1 parent 9f1d8bb commit 3349256

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

esp32/mods/machuart.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -301,29 +301,23 @@ STATIC void mach_uart_print(const mp_print_t *print, mp_obj_t self_in, mp_print_
301301
}
302302
if (self->invert) {
303303
mp_printf(print, ", invert=");
304-
uint32_t invert_mask = self->invert;
305-
if (invert_mask & UART_INVERSE_TXD) {
304+
char *prequel = "";
305+
if (self->invert & UART_INVERSE_TXD) {
306306
mp_print_str(print, "INV_TX");
307-
invert_mask &= ~UART_INVERSE_TXD;
308-
if (invert_mask) {
309-
mp_print_str(print, "|");
310-
}
307+
prequel = "|";
311308
}
312-
if (invert_mask & UART_INVERSE_RXD) {
309+
if (self->invert & UART_INVERSE_RXD) {
310+
mp_print_str(print, prequel);
313311
mp_print_str(print, "INV_RX");
314-
invert_mask &= ~UART_INVERSE_RXD;
315-
if (invert_mask) {
316-
mp_print_str(print, "|");
317-
}
312+
prequel = "|";
318313
}
319-
if (invert_mask & UART_INVERSE_RTS) {
314+
if (self->invert & UART_INVERSE_RTS) {
315+
mp_print_str(print, prequel);
320316
mp_print_str(print, "INV_RTS");
321-
invert_mask &= ~UART_INVERSE_RTS;
322-
if (invert_mask) {
323-
mp_print_str(print, "|");
324-
}
317+
prequel = "|";
325318
}
326-
if (invert_mask & UART_INVERSE_CTS) {
319+
if (self->invert & UART_INVERSE_CTS) {
320+
mp_print_str(print, prequel);
327321
mp_print_str(print, "INV_CTS");
328322
}
329323
}

0 commit comments

Comments
 (0)
0