From 9912628c44e0b1cb6332c19578e4a44e02cdd46c Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Wed, 15 Jan 2020 08:12:56 +0100 Subject: [PATCH] ftdipp_mpsse: use max_packet_size to determine internal buffer size --- ftdipp_mpsse.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ftdipp_mpsse.cpp b/ftdipp_mpsse.cpp index 357a58a..47ad2d7 100644 --- a/ftdipp_mpsse.cpp +++ b/ftdipp_mpsse.cpp @@ -29,6 +29,7 @@ FTDIpp_MPSSE::FTDIpp_MPSSE(const string &dev, unsigned char interface, } open_device(115200); + _buffer_size = _ftdi->max_packet_size; _buffer = (unsigned char *)malloc(sizeof(unsigned char) * _buffer_size); if (!_buffer) { @@ -44,6 +45,7 @@ FTDIpp_MPSSE::FTDIpp_MPSSE(int vid, int pid, unsigned char interface, _clkHZ(clkHZ), _buffer_size(2*32768), _num(0) { open_device(115200); + _buffer_size = _ftdi->max_packet_size; _buffer = (unsigned char *)malloc(sizeof(unsigned char) * _buffer_size); if (!_buffer) {