Fix pointer check in serial redirect (#707)

This commit is contained in:
Philipp Henkel 2018-03-14 03:24:10 +01:00 committed by Peli de Halleux
parent 794fdf0f0f
commit 8be29202aa

View File

@ -155,8 +155,8 @@ namespace serial {
//% rx.fieldOptions.tooltips="false"
//% blockGap=8
void redirect(SerialPin tx, SerialPin rx, BaudRate rate) {
MicroBitPin* txp = getPin(tx); if (!tx) return;
MicroBitPin* rxp = getPin(rx); if (!rx) return;
MicroBitPin* txp = getPin(tx); if (!txp) return;
MicroBitPin* rxp = getPin(rx); if (!rxp) return;
uBit.serial.redirect(txp->name, rxp->name);
uBit.serial.baud((int)rate);