fix for Microsoft/pxt#961
This commit is contained in:
parent
50f0e85884
commit
4ebe9f595a
@ -92,7 +92,10 @@ namespace serial {
|
|||||||
//% blockId=serial_redirect block="serial|redirect to|TX %tx|RX %rx|at baud rate %rate"
|
//% blockId=serial_redirect block="serial|redirect to|TX %tx|RX %rx|at baud rate %rate"
|
||||||
//% blockExternalInputs=1
|
//% blockExternalInputs=1
|
||||||
void redirect(SerialPin tx, SerialPin rx, BaudRate rate) {
|
void redirect(SerialPin tx, SerialPin rx, BaudRate rate) {
|
||||||
uBit.serial.redirect((PinName)tx, (PinName)rx);
|
MicroBitPin* txp = getPin(tx); if (!tx) return;
|
||||||
|
MicroBitPin* rxp = getPin(rx); if (!rx) return;
|
||||||
|
|
||||||
|
uBit.serial.redirect(txp->name, rxp->name);
|
||||||
uBit.serial.baud((int)rate);
|
uBit.serial.baud((int)rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user