Skip to content

Commit 5c3d638

Browse files
authored
Add debug builds (and more output), fix port not being cleared before first getting settings (TeamOpenFIRE#85)
* Export debug builds in actions, print received input from board during sync * Append build type to artifact, oops * Because Wendies is cranky about RelWithDebugInfo * Potential fixes for RaspPi?
1 parent 24b4987 commit 5c3d638

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2019]
1717
qt_version: [5.15.2, 6.7.3, 6.8.3]
18-
build_type: [Release]
18+
build_type: [Debug, Release]
1919
include:
2020
- os: windows-2019
2121
c_compiler: cl
@@ -137,7 +137,7 @@ jobs:
137137
uses: actions/upload-artifact@v4
138138
with:
139139
# Artifact name
140-
name: OpenFIREapp-${{ matrix.pretty }}-Qt${{ matrix.qt_version }} # optional, default is artifact
140+
name: OpenFIREapp-${{ matrix.pretty }}-Qt${{ matrix.qt_version }}-${{ matrix.build_type }} # optional, default is artifact
141141
# A file, directory or wildcard pattern that describes what to upload
142142
path: ${{ matrix.file }}
143143

src/appserial.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ bool AppSerial::GetSettings(const QString &portName)
8585
port.clear();
8686

8787
if(char buf[] = {(char)OF_Const::sDock1, (char)OF_Const::sDock2}; OneShotSend(buf, 2, true)) {
88+
#ifdef OFAPP_DEBUG
89+
qDebug() << port.peek(port.bytesAvailable());
90+
#endif
8891
QList<QByteArray> buffer = port.readLine().split((char)OF_Const::serialTerminator);
8992

9093
if(buffer.size() >= 3) {
@@ -113,6 +116,8 @@ bool AppSerial::GetSettings(const QString &portName)
113116
"Otherwise, the camera wires must be resoldered to resolve this error.</p>",
114117
QMessageBox::Warning);
115118

119+
port.clear();
120+
116121
////* toggles *////
117122
if(OneShotSend((char)OF_Const::sGetToggles, true)) {
118123
memset(App_Common::boolSettings, false, sizeof(App_Common::boolSettings));
@@ -280,15 +285,20 @@ bool AppSerial::BatchStoreSettings(void *dataPtr, const std::unordered_map<std::
280285
}
281286
// String not detected, skip over
282287
} else {
283-
printf("No data found for %s\n", buf.constData());
288+
qDebug() << "No data found for" << buf;
284289
// skip the profile num byte if reading profile type data
285290
if(&dataMap == &App_Common::OFPresets.profSettingTypes_Strings) {
286-
if(!port.bytesAvailable()) if(!port.waitForReadyRead(500)) return false;
291+
if(!port.bytesAvailable()) port.waitForReadyRead(500);
287292
buf += port.read(1);
288293
}
289-
if(port.bytesAvailable() < sizeRead) if(!port.waitForReadyRead(500)) return false;
294+
if(port.bytesAvailable() < sizeRead) port.waitForReadyRead(500);
290295
buf += port.read(sizeRead);
291296
}
297+
298+
#ifdef OFAPP_DEBUG
299+
qDebug() << buf;
300+
#endif
301+
292302
// Report back received buffer to board for verification
293303
// (board will re-send output if buffers aren't matching)
294304
OneShotSend(buf.constData(), buf.length());

0 commit comments

Comments
 (0)