Skip to content

Commit

Permalink
small can board
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 3, 2023
1 parent 93cf484 commit 9474781
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions firmware/console/status_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ static int packEngineMode() {
engineConfiguration->ignitionMode;
}

static int prevCkpEventCounter = -1;

/**
* Time when the firmware version was last reported
* TODO: implement a request/response instead of just constantly sending this out
Expand Down Expand Up @@ -184,8 +182,6 @@ void printOverallStatus() {
}
}

static systime_t timeOfPreviousReport = (systime_t) -1;

#if !defined(LOGIC_ANALYZER_BUFFER_SIZE)
// TODO: how small can this be?
#define LOGIC_ANALYZER_BUFFER_SIZE 1000
Expand Down Expand Up @@ -215,9 +211,12 @@ void updateDevConsoleState() {
printFullAdcReportIfNeeded();
#endif /* HAL_USE_ADC */

#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
systime_t nowSeconds = getTimeNowS();

#if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT
static systime_t timeOfPreviousReport = (systime_t) -1;
static int prevCkpEventCounter = -1;

int currentCkpEventCounter = engine->triggerCentral.triggerState.getTotalEventCounter();
if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) {
return;
Expand Down
14 changes: 7 additions & 7 deletions firmware/development/engine_sniffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

#include "engine_sniffer.h"

// a bit weird because of conditional compilation
static char shaft_signal_msg_index[15];

#if EFI_ENGINE_SNIFFER
#define addEngineSnifferEvent(name, msg) { if (getTriggerCentral()->isEngineSnifferEnabled) { waveChart.addEvent3((name), (msg)); } }
#else
Expand All @@ -45,6 +42,8 @@ static char shaft_signal_msg_index[15];
#define CHART_DELIMETER '!'
extern WaveChart waveChart;

static char shaft_signal_msg_index[15];

/**
* This is the number of events in the digital chart which would be displayed
* on the 'digital sniffer' pane
Expand Down Expand Up @@ -242,8 +241,6 @@ void initWaveChart(WaveChart *chart) {
#endif // EFI_UNIT_TEST
}

#endif /* EFI_ENGINE_SNIFFER */

void addEngineSnifferOutputPinEvent(NamedOutputPin *pin, bool isRise) {
if (!engineConfiguration->engineSnifferFocusOnInputs) {
addEngineSnifferEvent(pin->getShortName(), isRise ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
Expand All @@ -253,9 +250,9 @@ void addEngineSnifferOutputPinEvent(NamedOutputPin *pin, bool isRise) {
void addEngineSnifferTdcEvent(int rpm) {
static char rpmBuffer[_MAX_FILLER];
itoa10(rpmBuffer, rpm);
#if EFI_ENGINE_SNIFFER

waveChart.startDataCollection();
#endif

addEngineSnifferEvent(TOP_DEAD_CENTER_MESSAGE, (char* ) rpmBuffer);
}

Expand All @@ -282,3 +279,6 @@ void addEngineSnifferVvtEvent(int vvtIndex, bool isRise) {

addEngineSnifferEvent(vvtName, isRise ? PROTOCOL_ES_UP : PROTOCOL_ES_DOWN);
}

#endif /* EFI_ENGINE_SNIFFER */

0 comments on commit 9474781

Please sign in to comment.