Skip to content

Commit f432931

Browse files
authored
Merge pull request #119 from SeongGino/Valkyrja
Fix error not being sent when trying to calibrate while cam is not working
2 parents 3c5de91 + 3a4478d commit f432931

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

OpenFIREmain/OpenFIREserial.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,13 @@ void OF_Serial::SerialProcessingDocked()
976976
if(Serial.peek() < PROFILE_COUNT) {
977977
FW_Common::SelectCalProfile(Serial.read());
978978
char buf[2] = {OF_Const::sCurrentProf, (uint8_t)OF_Prefs::currentProfile};
979-
Serial.write(buf, 2);
979+
Serial.write(buf, sizeof(buf));
980980
if(Serial.read() == OF_Const::sCaliStart) {
981-
if(FW_Common::camNotAvailable) Serial.write(OF_Const::sError);
982-
else {
981+
if(FW_Common::camNotAvailable) {
982+
buf[0] = OF_Const::sError;
983+
buf[1] = OF_Const::sErrCam;
984+
Serial.write(buf, sizeof(buf));
985+
} else {
983986
// sensitivity/layout preset
984987
if(Serial.peek() != -1) {
985988
FW_Common::SetIrSensitivity(Serial.peek() & 0b11110000);

0 commit comments

Comments
 (0)