Skip to content

Commit

Permalink
debug channels cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Sep 13, 2023
1 parent 828715d commit 3b0d033
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
5 changes: 0 additions & 5 deletions firmware/console/status_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,6 @@ DcHardware *getdcHardware();
tle8888PostState();
#endif /* BOARD_TLE8888_COUNT */
break;
case DBG_LOGIC_ANALYZER:
#if EFI_LOGIC_ANALYZER
reportLogicAnalyzerToTS();
#endif /* EFI_LOGIC_ANALYZER */
break;
default:
;
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/engine_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ typedef enum __attribute__ ((__packed__)) {
DBG_UNUSED_42 = 42,
DBG_43 = 43,
DBG_DYNO_VIEW = 44,
DBG_LOGIC_ANALYZER = 45,
DBG_45 = 45,
DBG_46 = 46,
DBG_TCU = 47,
DBG_LUA = 48,
Expand Down
29 changes: 0 additions & 29 deletions firmware/development/logic_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,33 +257,4 @@ void stopLogicAnalyzerPins() {
}
}

template <typename TFreq>
static void getChannelFreqAndDuty(int index, float& duty, TFreq& freq) {
if (readers[index].line == 0) {
duty = 0.0;
freq = 0;
} else {
float high = getSignalOnTime(index);
float period = getSignalPeriodMs(index);

if (period != 0) {

duty = (high * 1000.0f) /(period * 10.0f);
freq = (int)(1 / (period / 1000.0f));
} else {
duty = 0.0;
freq = 0;
}
}
}

void reportLogicAnalyzerToTS() {
#if EFI_TUNER_STUDIO
getChannelFreqAndDuty(0, engine->outputChannels.debugFloatField1, engine->outputChannels.debugIntField1);
getChannelFreqAndDuty(1, engine->outputChannels.debugFloatField2, engine->outputChannels.debugIntField2);
getChannelFreqAndDuty(2, engine->outputChannels.debugFloatField3, engine->outputChannels.debugIntField3);
getChannelFreqAndDuty(3, engine->outputChannels.debugFloatField4, engine->outputChannels.debugIntField4);
#endif
}

#endif /* EFI_LOGIC_ANALYZER */
1 change: 0 additions & 1 deletion firmware/development/logic_analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ void startLogicAnalyzerPins();
void stopLogicAnalyzerPins();
void printWave(Logging *logging);
void showWaveInfo(void);
void reportLogicAnalyzerToTS(void);

void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp);

Expand Down

0 comments on commit 3b0d033

Please sign in to comment.