MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / setBufferSizes

Method setBufferSizes

external/floppybridge/src/SerialIO.cpp:458–472  ·  view source on GitHub ↗

Attempt ot change the size of the buffers used by the OS

Source from the content-addressed store, hash-verified

456
457// Attempt ot change the size of the buffers used by the OS
458void SerialIO::setBufferSizes(const unsigned int rxSize, const unsigned int txSize) {
459 if (!isPortOpen()) return;
460
461#ifdef FTDI_D2XX_AVAILABLE
462 if (m_ftdi.isOpen()) {
463 // Larger than this size actually causes slowdowns. This doesn't work the same as below. Below is a buffer in Windows. This is on the USB device I think
464 m_ftdi.FT_SetUSBParameters(rxSize < 256 ? rxSize : 256, txSize);
465 return;
466 }
467#endif
468
469#ifdef _WIN32
470 SetupComm(m_portHandle, rxSize, txSize);
471#endif
472}
473
474// Open a port by name
475SerialIO::Response SerialIO::openPort(const std::wstring& portName) {

Callers 2

internalOpenPortMethod · 0.80
openPortMethod · 0.80

Calls 2

FT_SetUSBParametersMethod · 0.80
isOpenMethod · 0.45

Tested by

no test coverage detected