mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-23 03:36:34 +00:00
Small improvements.
This commit is contained in:
@@ -8,13 +8,13 @@ TARGET = a8_remote
|
||||
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 = clang++
|
||||
QMAKE_CC = clang
|
||||
QMAKE_CXX = g++
|
||||
QMAKE_CC = gcc
|
||||
|
||||
# Not nice, but for some reason QtCreator doesn't use /usr/lib/ccache/g++ from the PATH
|
||||
linux-g++ {
|
||||
QMAKE_CXX = clang++
|
||||
QMAKE_CC = clang
|
||||
QMAKE_CXX = g++
|
||||
QMAKE_CC = gcc
|
||||
}
|
||||
|
||||
SOURCES += \
|
||||
|
||||
@@ -88,8 +88,11 @@ void RemoteControl::sendData(uint16_t top, uint16_t left, uint16_t bottom, uint1
|
||||
QJsonObject commandObject = {{"sender", FIFO_WHO_AM_I}, {"top", top}, {"left", left}, {"bottom", bottom}, {"right", right}};
|
||||
QJsonDocument commandDocument(commandObject);
|
||||
std::string command = commandDocument.toJson(QJsonDocument::Compact).toStdString();
|
||||
write(mFifoFdOut, command.c_str(), command.size());
|
||||
//qDebug().noquote().nospace() << "Sent: " << command;
|
||||
size_t bytesWritten = write(mFifoFdOut, command.c_str(), command.size());
|
||||
if (bytesWritten < 1) {
|
||||
qWarning().noquote().nospace() << "Error writing data: " << bytesWritten;
|
||||
}
|
||||
qDebug().noquote().nospace() << "Sent: " << command;
|
||||
}
|
||||
|
||||
#ifdef FIFO_TEST
|
||||
@@ -124,7 +127,10 @@ void RemoteControl::startTest()
|
||||
|
||||
QJsonDocument commandDocument(commandObject);
|
||||
std::string command = commandDocument.toJson(QJsonDocument::Compact).toStdString();
|
||||
write(mFifoFdOut, command.c_str(), command.size());
|
||||
size_t bytesWritten = write(mFifoFdOut, command.c_str(), command.size());
|
||||
if (bytesWritten < 1) {
|
||||
qWarning().noquote().nospace() << "Error writing data: " << bytesWritten;
|
||||
}
|
||||
qDebug().noquote().nospace() << "Sent: " << command;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user