File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,14 @@ class UartClass : public HardwareSerial
168
168
using Print::write; // pull in write(str) and write(buf, size) from Print
169
169
explicit operator bool () { return true ; }
170
170
171
+ void bind (UartClass& ser) {bound = &ser; }
172
+
171
173
// Interrupt handlers - Not intended to be called externally
172
174
inline void _rx_complete_irq (void );
173
175
void _tx_data_empty_irq (void );
174
176
private:
175
177
void _poll_tx_data_empty (void );
178
+ UartClass* bound = NULL ;
176
179
};
177
180
178
181
#if defined(HWSERIAL0)
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ void UartClass::_rx_complete_irq(void)
66
66
_rx_buffer [_rx_buffer_head ] = c ;
67
67
_rx_buffer_head = i ;
68
68
}
69
+ if (bound != NULL ) {
70
+ bound -> write (c );
71
+ }
69
72
} else {
70
73
// Parity error, read byte but discard it
71
74
(* _hwserial_module ).RXDATAL ;
You can’t perform that action at this time.
0 commit comments