File tree Expand file tree Collapse file tree 5 files changed +8
-16
lines changed
espressif/common-hal/busio
mimxrt10xx/common-hal/busio Expand file tree Collapse file tree 5 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -1987,10 +1987,6 @@ msgstr ""
1987
1987
msgid "Stopping AP is not supported."
1988
1988
msgstr ""
1989
1989
1990
- #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
1991
- msgid "Supply at least one UART pin"
1992
- msgstr ""
1993
-
1994
1990
#: shared-bindings/alarm/time/TimeAlarm.c
1995
1991
msgid "Supply one of monotonic_time or epoch_time"
1996
1992
msgstr ""
@@ -4116,8 +4112,6 @@ msgstr ""
4116
4112
msgid "twai_start returned esp-idf error #%d"
4117
4113
msgstr ""
4118
4114
4119
- #: ports/atmel-samd/common-hal/busio/UART.c
4120
- #: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
4121
4115
#: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c
4122
4116
msgid "tx and rx cannot both be None"
4123
4117
msgstr ""
Original file line number Diff line number Diff line change @@ -112,9 +112,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
112
112
113
113
uart_config_t uart_config = {0 };
114
114
bool have_rs485_dir = rs485_dir != NULL ;
115
- if (!have_tx && !have_rx ) {
116
- mp_raise_ValueError (translate ("tx and rx cannot both be None" ));
117
- }
115
+
116
+ // shared-bindings checks that TX and RX are not both None, so we don't need to check here.
118
117
119
118
// Filter for sane settings for RS485
120
119
if (have_rs485_dir ) {
Original file line number Diff line number Diff line change @@ -179,7 +179,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
179
179
break ;
180
180
}
181
181
} else {
182
- mp_raise_ValueError (translate ("tx and rx cannot both be None" ));
182
+ // TX and RX are both None. But this is already handled in shared-bindings, so
183
+ // we won't get here.
183
184
}
184
185
185
186
if (rx && !rx_config ) {
Original file line number Diff line number Diff line change @@ -183,9 +183,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
183
183
mp_raise_ValueError (translate ("All UART peripherals are in use" ));
184
184
}
185
185
186
- if ((tx == NULL ) && (rx == NULL )) {
187
- mp_raise_ValueError (translate ("tx and rx cannot both be None" ));
188
- }
186
+ // shared-bindings checks that TX and RX are not both None, so we don't need to check here.
189
187
190
188
mp_arg_validate_int_min (receiver_buffer_size , 1 , MP_QSTR_receiver_buffer_size );
191
189
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
85
85
bool sigint_enabled ) {
86
86
87
87
// match pins to UART objects
88
- USART_TypeDef * USARTx ;
88
+ USART_TypeDef * USARTx = NULL ;
89
89
90
90
uint8_t tx_len = MP_ARRAY_SIZE (mcu_uart_tx_list );
91
91
uint8_t rx_len = MP_ARRAY_SIZE (mcu_uart_rx_list );
@@ -159,8 +159,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
159
159
USARTx = assign_uart_or_throw (self , (self -> tx != NULL ),
160
160
periph_index , uart_taken );
161
161
} else {
162
- // both pins cannot be empty
163
- mp_raise_ValueError ( translate ( "tx and rx cannot both be None" ));
162
+ // TX and RX are both None. But this is already handled in shared-bindings, so
163
+ // we won't get here.
164
164
}
165
165
166
166
// Other errors
You can’t perform that action at this time.
0 commit comments