1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

added conditional debug (TRAMP_DEBUG)

This commit is contained in:
Raphael Coeffic 2017-01-15 23:26:08 +01:00
parent af72b761b5
commit 47bbd46c88

View file

@ -293,11 +293,20 @@ void trampProcess(uint32_t currentTimeUs)
{
static uint32_t lastQueryTimeUs = 0;
#ifdef TRAMP_DEBUG
static uint16_t debugFreqReqCounter = 0;
static uint16_t debugPowReqCounter = 0;
#endif
if (trampStatus == TRAMP_STATUS_BAD_DEVICE)
return;
char replyCode = trampReceive(currentTimeUs);
#ifdef TRAMP_DEBUG
debug[0] = trampStatus;
#endif
switch(replyCode) {
case 'r':
if (trampStatus <= TRAMP_STATUS_OFFLINE)
@ -331,10 +340,16 @@ void trampProcess(uint32_t currentTimeUs)
bool done = true;
if (trampConfFreq != trampCurFreq) {
trampSendFreq(trampConfFreq);
#ifdef TRAMP_DEBUG
debugFreqReqCounter++;
#endif
done = false;
}
else if (trampConfPower != trampCurConfigPower) {
trampSendRFPower(trampConfPower);
#ifdef TRAMP_DEBUG
debugPowReqCounter++;
#endif
done = false;
}
@ -362,6 +377,12 @@ void trampProcess(uint32_t currentTimeUs)
break;
}
#ifdef TRAMP_DEBUG
debug[1] = debugFreqReqCounter;
debug[2] = debugPowReqCounter;
debug[3] = 0;
#endif
#ifdef CMS
trampCmsUpdateStatusString();
#endif