Re-initialise a serial channel.
| 3434 | |
| 3435 | // Re-initialise a serial channel. |
| 3436 | void Platform::ResetChannel(size_t chan) noexcept |
| 3437 | { |
| 3438 | if (chan == 0) |
| 3439 | { |
| 3440 | SERIAL_MAIN_DEVICE.end(); |
| 3441 | #if SAME5x && !CORE_USES_TINYUSB |
| 3442 | SERIAL_MAIN_DEVICE.Start(); |
| 3443 | #else |
| 3444 | SERIAL_MAIN_DEVICE.Start(UsbVBusPin); |
| 3445 | #endif |
| 3446 | } |
| 3447 | #if HAS_AUX_DEVICES |
| 3448 | else if (chan < NumSerialChannels) |
| 3449 | { |
| 3450 | AuxDevice& device = auxDevices[chan - FirstAuxChannel]; |
| 3451 | AuxMode mode = device.GetMode(); |
| 3452 | device.Disable(); |
| 3453 | device.SetMode(mode); |
| 3454 | } |
| 3455 | #endif |
| 3456 | } |
| 3457 | |
| 3458 | #if defined(DUET3_MB6HC) |
| 3459 |