Minor changes.

This commit is contained in:
Nffj84
2024-07-04 13:31:28 +03:00
parent d377a626e2
commit f419d69dab
8 changed files with 18 additions and 13 deletions
+4 -4
View File
@@ -6,8 +6,8 @@ CONFIG += c++17 console
TARGET = a8
QMAKE_CXXFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
QMAKE_LFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
#QMAKE_CXXFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
#QMAKE_LFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
QMAKE_CXX = g++
QMAKE_CC = gcc
@@ -32,8 +32,8 @@ SOURCES += \
HEADERS += \
config.hpp \
defines.hpp \
localControl.h \
remoteControl.h \
localControl.hpp \
remoteControl.hpp \
serialCommand.hpp \
serialPort.hpp \
serialResponse.hpp \
+1 -1
View File
@@ -1,4 +1,4 @@
#include "localControl.h"
#include "localControl.hpp"
#include <QCoreApplication>
#include <QDebug>
#include <QObject>
+7 -3
View File
@@ -2,8 +2,8 @@
#include <QCoreApplication>
#include <QThread>
#include "config.hpp"
#include "localControl.h"
#include "remoteControl.h"
#include "localControl.hpp"
#include "remoteControl.hpp"
#include "serialCommand.hpp"
#include "serialPort.hpp"
@@ -11,6 +11,8 @@ int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption lOption(QStringList() << "l", "Use local mode");
parser.addOption(lOption);
QCommandLineOption pOption(QStringList() << "p", "Use serial port", "value");
@@ -24,9 +26,11 @@ int main(int argc, char *argv[])
if (parser.isSet(pOption)) {
useSerialPort = parser.value(pOption);
}
qDebug() << useRemoteMode;
qDebug() << useSerialPort;
SerialCommand serialCommand;
SerialPort serialPort(useSerialPort);
SerialCommand serialCommand;
Config::setInitalValues(&serialPort, &serialCommand);
// Remote mode will read commands from pipe
+1 -1
View File
@@ -1,4 +1,4 @@
#include "remoteControl.h"
#include "remoteControl.hpp"
#include <QCoreApplication>
#include <QDebug>
#include <QJsonDocument>
+4 -3
View File
@@ -21,11 +21,12 @@ SerialPort::SerialPort(QString usePort)
// Open the serial port
if (openPort() == false) {
qCritical().noquote().nospace() << "SerialPort(): Unable to open port " << port;
return;
qCritical().noquote().nospace() << "SerialPort(): Unable to open port " << usePort;
delete mSerialPort;
exit(EXIT_FAILURE);
}
qDebug().noquote().nospace() << "SerialPort(): Opened port " << port;
qDebug().noquote().nospace() << "SerialPort(): Opened port " << usePort;
}
SerialPort::~SerialPort()
+1 -1
View File
@@ -6,10 +6,10 @@
#include <QThread>
#include <QTimer>
#include <fcntl.h>
#include <iostream>
#include <sys/stat.h>
#include <unistd.h>
#ifdef FIFO_TEST
#include <iostream>
#include <random>
#endif