diff --git a/misc/camera/a8/a8.pro b/misc/camera/a8/a8.pro index cecda6f..62c38ea 100644 --- a/misc/camera/a8/a8.pro +++ b/misc/camera/a8/a8.pro @@ -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 \ diff --git a/misc/camera/a8/localControl.cpp b/misc/camera/a8/localControl.cpp index 1ec9c7d..c7561b4 100644 --- a/misc/camera/a8/localControl.cpp +++ b/misc/camera/a8/localControl.cpp @@ -1,4 +1,4 @@ -#include "localControl.h" +#include "localControl.hpp" #include #include #include diff --git a/misc/camera/a8/localControl.h b/misc/camera/a8/localControl.hpp similarity index 100% rename from misc/camera/a8/localControl.h rename to misc/camera/a8/localControl.hpp diff --git a/misc/camera/a8/main.cpp b/misc/camera/a8/main.cpp index 1d3466c..a319ffa 100644 --- a/misc/camera/a8/main.cpp +++ b/misc/camera/a8/main.cpp @@ -2,8 +2,8 @@ #include #include #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 diff --git a/misc/camera/a8/remoteControl.cpp b/misc/camera/a8/remoteControl.cpp index f140b47..a0563e9 100644 --- a/misc/camera/a8/remoteControl.cpp +++ b/misc/camera/a8/remoteControl.cpp @@ -1,4 +1,4 @@ -#include "remoteControl.h" +#include "remoteControl.hpp" #include #include #include diff --git a/misc/camera/a8/remoteControl.h b/misc/camera/a8/remoteControl.hpp similarity index 100% rename from misc/camera/a8/remoteControl.h rename to misc/camera/a8/remoteControl.hpp diff --git a/misc/camera/a8/serialPort.cpp b/misc/camera/a8/serialPort.cpp index a5444a1..396988d 100644 --- a/misc/camera/a8/serialPort.cpp +++ b/misc/camera/a8/serialPort.cpp @@ -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() diff --git a/misc/camera/a8_remote/remoteControl.cpp b/misc/camera/a8_remote/remoteControl.cpp index 9a918a2..0d3ef76 100644 --- a/misc/camera/a8_remote/remoteControl.cpp +++ b/misc/camera/a8_remote/remoteControl.cpp @@ -6,10 +6,10 @@ #include #include #include -#include #include #include #ifdef FIFO_TEST +#include #include #endif