Skip to content

Commit

Permalink
signalDecoder.cpp
Browse files Browse the repository at this point in the history
#62 Additional debug, to find mc problem
  • Loading branch information
sidey79 committed Oct 25, 2017
1 parent 7f19f01 commit a888d4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/_micro-api/libraries/signalDecoder/src/signalDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,15 @@ inline void SignalDetectorClass::doDetect()
// if (messageLen == 0) pattern_pos = patternLen = 0;
// if (messageLen == 0) valid = true;
if (!valid) {
//MSG_PRINT(" not valid ");

// Try output
processMessage();

// processMessage was not able to find anything useful in our buffer. As the pulses are not valid, we reset and start new buffering. Also a check if pattern has opposit sign is done here again to prevent failuer adding after a move
if (success == false || (messageLen > 0 && last != NULL && (*first ^ *last) > 0)) {
MSG_PRINT(" nv reset");

reset();
valid = true;
}
Expand Down Expand Up @@ -545,6 +549,7 @@ void SignalDetectorClass::processMessage()
if (MCenabled)
{
//DBG_PRINT(" mc: ");
//MSG_PRINT(" try mc ");

static ManchesterpatternDecoder mcdecoder(this); // Init Manchester Decoder class

Expand All @@ -563,7 +568,7 @@ void SignalDetectorClass::processMessage()
MSG_PRINT(" MC found: ");
#endif // DEBUGDECODE

#if DEBUGDECODE == 1
//#if DEBUGDECODE == 1 // todo kommentar entfernen
MSG_PRINT(MSG_START);
MSG_PRINT("MC");
MSG_PRINT(SERIAL_DELIMITER);
Expand All @@ -588,7 +593,7 @@ void SignalDetectorClass::processMessage()
MSG_PRINT(SERIAL_DELIMITER);
}
MSG_PRINTLN(MSG_END);
#endif
//#endif
MSG_PRINT(MSG_START);
MSG_PRINT("MC");
MSG_PRINT(SERIAL_DELIMITER);
Expand Down Expand Up @@ -617,12 +622,14 @@ void SignalDetectorClass::processMessage()

}
else if (mcDetected == true && m_truncated == true) {
//MSG_PRINT(" mc true");

success = true; // Prevents MU Processing
}

}
if (MUenabled && state == clockfound && success == false && messageLen >= minMessageLen) {
//MSG_PRINT(" try mu");

#if DEBUGDECODE > 1
DBG_PRINT(" MU found: ");
Expand Down

0 comments on commit a888d4b

Please sign in to comment.