rusEFI
The most advanced open source ECU
Functions
knock_spectrogram.h File Reference

Detailed Description

Date
Feb 20, 2023
Author
Alexey Ershov, (c) 2012-2023

Definition in file knock_spectrogram.h.

Functions

void knockSpectorgramAddLine (float main_freq, float *data, size_t size)
 

Function Documentation

◆ knockSpectorgramAddLine()

void knockSpectorgramAddLine ( float  main_freq,
float *  data,
size_t  size 
)

Definition at line 66 of file knock_spectrogram.cpp.

66  {
67 #if EFI_TEXT_LOGGING
68  if (scLogging.remainingSize() > size) {
69 
70  float min = 99999999999;
71  float max = -99999999999;
72  for(size_t i = 0; i < size; ++i) {
73  float v = data[i];
74  if(v < min) {
75  min = v;
76  }
77 
78  if(v > max) {
79  max = v;
80  }
81  }
82 
83  scLogging.reset();
84  scLogging.appendPrintf(PROTOCOL_KNOCK_SPECTROGRAMM LOG_DELIMITER);
85 
86  scLogging.appendFloat(main_freq, 2);
88 
89  scLogging.appendChar((char)size);
90 
91  base64(scLogging, data, size, min, max);
92 
93  scLogging.append(LOG_DELIMITER);
94 
96  }
97 
98 #endif /* EFI_TEXT_LOGGING */
99 }
void appendChar(char c)
Definition: datalogging.h:40
void void appendFloat(float value, int precision)
Definition: datalogging.cpp:97
size_t remainingSize() const
Definition: datalogging.h:49
void reset()
void appendPrintf(const char *fmt,...) __attribute__((format(printf
Definition: datalogging.cpp:80
void base64(Logging &l, const float *data, size_t size, const float &min, const float &max)
static Logging scLogging("knock_spectrogram", PROTOCOL_KNOCK_SPECTROGRAMM_BUFFER, sizeof(PROTOCOL_KNOCK_SPECTROGRAMM_BUFFER))
void scheduleLogging(Logging *logging)
composite packet size

Referenced by processLastKnockEvent().

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

Go to the source code of this file.