File tree 1 file changed +13
-3
lines changed 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ void uartDisableInterrupt(uart_t* uart)
155
155
156
156
void uartDetachRx (uart_t * uart , uint8_t rxPin )
157
157
{
158
- if (uart == NULL ){
158
+ if (uart == NULL ) {
159
159
return ;
160
160
}
161
161
pinMatrixInDetach (rxPin , false, false);
@@ -164,12 +164,22 @@ void uartDetachRx(uart_t* uart, uint8_t rxPin)
164
164
165
165
void uartDetachTx (uart_t * uart , uint8_t txPin )
166
166
{
167
- if (uart == NULL ){
167
+ if (uart == NULL ) {
168
168
return ;
169
169
}
170
170
pinMatrixOutDetach (txPin , false, false);
171
171
}
172
172
173
+ void uartAttachRx (uart_t * uart , uint8_t rxPin , bool inverted )
174
+ {
175
+ if (uart == NULL || rxPin > 39 ) {
176
+ return ;
177
+ }
178
+ pinMode (rxPin , INPUT );
179
+ pinMatrixInAttach (rxPin , UART_RXD_IDX (uart -> num ), inverted );
180
+ uartEnableInterrupt (uart );
181
+ }
182
+
173
183
void uartAttachTx (uart_t * uart , uint8_t txPin , bool inverted )
174
184
{
175
185
if (uart == NULL || txPin > 39 ) {
@@ -651,4 +661,4 @@ uartDetectBaudrate(uart_t *uart)
651
661
*/
652
662
bool uartRxActive (uart_t * uart ) {
653
663
return uart -> dev -> status .st_urx_out != 0 ;
654
- }
664
+ }
You can’t perform that action at this time.
0 commit comments