rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
sensor_chart.h File Reference

Detailed Description

Date
Dec 20, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file sensor_chart.h.

Functions

void scAddData (float angle, float value)
 
void initSensorChart (void)
 
void publishSensorChartIfFull ()
 

Function Documentation

◆ initSensorChart()

void initSensorChart ( void  )

Definition at line 76 of file sensor_chart.cpp.

76 {
77#if EFI_SIMULATOR
78 printf("initSensorChart\n");
79#endif
80
81 initialized = true;
82}
static int initialized
printf("\n")

Referenced by commonInitEngineController().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publishSensorChartIfFull()

void publishSensorChartIfFull ( )

Definition at line 84 of file sensor_chart.cpp.

84 {
85 if (state != ScState::Full) {
86 return;
87 }
88
89 scLogging.appendPrintf(LOG_DELIMITER);
91
93}
void appendPrintf(const char *fmt,...) __attribute__((format(printf
void scheduleLogging(Logging *logging)
static Logging scLogging("analog chart", LOGGING_BUFFER, sizeof(LOGGING_BUFFER))
static ScState state

Referenced by printOverallStatus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scAddData()

void scAddData ( float  angle,
float  value 
)

Definition at line 32 of file sensor_chart.cpp.

32 {
33#if EFI_TEXT_LOGGING
34 if (!initialized) {
35 return; // this is possible because of initialization sequence
36 }
37
38 // Don't log if we need a flush
39 if (state == ScState::Full) {
40 return;
41 }
42
43 auto currentRev = getRevolutionCounter();
44
45 if (state == ScState::PreArm) {
46 // nothing to do - we just need to grab the rev counter once so we can detect a change
48 } else if (state == ScState::Armed) {
49 // If armed, wait for a NEW revolution to start
50 if (lastRevCount != currentRev) {
52
53 // Reset logging and append header
55 scLogging.appendPrintf(PROTOCOL_ANALOG_CHART LOG_DELIMITER);
56 }
57 } else if (state == ScState::Logging) {
58 // If running and the revolution idx changes, terminate logging and wait for flush
59 if (lastRevCount != currentRev) {
61 }
62 }
63
64 lastRevCount = currentRev;
65
66 if (state == ScState::Logging) {
67 if (scLogging.remainingSize() > 100) {
68 scLogging.appendPrintf( "%.2f|%.2f|", angle, value);
69 } else {
71 }
72 }
73#endif /* EFI_TEXT_LOGGING */
74}
size_t remainingSize() const
Definition datalogging.h:49
void reset()
static uint32_t lastRevCount

Referenced by onFastAdcComplete(), rpmShaftPositionCallback(), and InstantRpmCalculator::updateInstantRpm().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.