mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
added conditional debug (TRAMP_DEBUG)
This commit is contained in:
parent
af72b761b5
commit
47bbd46c88
1 changed files with 21 additions and 0 deletions
|
@ -293,11 +293,20 @@ void trampProcess(uint32_t currentTimeUs)
|
||||||
{
|
{
|
||||||
static uint32_t lastQueryTimeUs = 0;
|
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)
|
if (trampStatus == TRAMP_STATUS_BAD_DEVICE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char replyCode = trampReceive(currentTimeUs);
|
char replyCode = trampReceive(currentTimeUs);
|
||||||
|
|
||||||
|
#ifdef TRAMP_DEBUG
|
||||||
|
debug[0] = trampStatus;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(replyCode) {
|
switch(replyCode) {
|
||||||
case 'r':
|
case 'r':
|
||||||
if (trampStatus <= TRAMP_STATUS_OFFLINE)
|
if (trampStatus <= TRAMP_STATUS_OFFLINE)
|
||||||
|
@ -331,10 +340,16 @@ void trampProcess(uint32_t currentTimeUs)
|
||||||
bool done = true;
|
bool done = true;
|
||||||
if (trampConfFreq != trampCurFreq) {
|
if (trampConfFreq != trampCurFreq) {
|
||||||
trampSendFreq(trampConfFreq);
|
trampSendFreq(trampConfFreq);
|
||||||
|
#ifdef TRAMP_DEBUG
|
||||||
|
debugFreqReqCounter++;
|
||||||
|
#endif
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
else if (trampConfPower != trampCurConfigPower) {
|
else if (trampConfPower != trampCurConfigPower) {
|
||||||
trampSendRFPower(trampConfPower);
|
trampSendRFPower(trampConfPower);
|
||||||
|
#ifdef TRAMP_DEBUG
|
||||||
|
debugPowReqCounter++;
|
||||||
|
#endif
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,6 +377,12 @@ void trampProcess(uint32_t currentTimeUs)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TRAMP_DEBUG
|
||||||
|
debug[1] = debugFreqReqCounter;
|
||||||
|
debug[2] = debugPowReqCounter;
|
||||||
|
debug[3] = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CMS
|
#ifdef CMS
|
||||||
trampCmsUpdateStatusString();
|
trampCmsUpdateStatusString();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue