From 8945ead5d634f2eaa87d5eb33ab40910b2c6e1e4 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 6 May 2024 06:24:25 +0200 Subject: [PATCH] set setting for opening serial device --- DownloadDCFirmware/mainwindow.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/DownloadDCFirmware/mainwindow.cpp b/DownloadDCFirmware/mainwindow.cpp index a636de8..a9e1b8c 100644 --- a/DownloadDCFirmware/mainwindow.cpp +++ b/DownloadDCFirmware/mainwindow.cpp @@ -24,6 +24,8 @@ MainWindow::MainWindow(QWidget *parent) ui->setupUi(this); + openSerialPort(); + //ui->updateProgress->setRange(0, 100); //ui->updateProgress->reset(); @@ -71,23 +73,18 @@ MainWindow::MainWindow(QWidget *parent) MainWindow::~MainWindow() { //delete m_startTimer; //delete m_exitTimer; + closeSerialPort(); delete ui; } bool MainWindow::openSerialPort() { // const SettingsDialog::Settings p = m_settings->settings(); - //m_serial->setPortName(p.name); - //m_serial->setBaudRate(p.baudRate); - //m_serial->setDataBits(p.dataBits); - //m_serial->setParity(p.parity); - //m_serial->setStopBits(p.stopBits); - ///m_serial->setFlowControl(p.flowControl); m_serial->setPortName(""); m_serial->setBaudRate(QSerialPort::Baud115200); m_serial->setDataBits(QSerialPort::DataBits::Data8); m_serial->setParity(QSerialPort::Parity::NoParity); m_serial->setStopBits(QSerialPort::StopBits::OneStop); - m_serial->setFlowControl(QSerialPort::FlowControl::HardwareControl); + m_serial->setFlowControl(QSerialPort::FlowControl::NoFlowControl); if (m_serial->open(QIODevice::ReadWrite)) { //m_console->setEnabled(true); //m_console->setLocalEchoEnabled(p.localEchoEnabled);