outputRequestPeriod into logs
This commit is contained in:
parent
9c83cfd696
commit
fae5f82125
|
@ -35,6 +35,8 @@ bool validateOffsetCount(size_t offset, size_t count, TsChannelBase* tsChannel)
|
|||
// the ECU. Forcing a reboot will force TS to re-read the tune CRC,
|
||||
bool rebootForPresetPending = false;
|
||||
|
||||
static efitimeus_t prevRequestTime = 0;
|
||||
|
||||
/**
|
||||
* @brief 'Output' command sends out a snapshot of current values
|
||||
* Gauges refresh
|
||||
|
@ -47,6 +49,12 @@ void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, u
|
|||
return;
|
||||
}
|
||||
|
||||
if (offset < BLOCKING_FACTOR) {
|
||||
efitimeus_t now = getTimeNowUs();
|
||||
engine->outputChannels.outputRequestPeriod = now - prevRequestTime;
|
||||
prevRequestTime = now;
|
||||
}
|
||||
|
||||
tsState.outputChannelsCommandCounter++;
|
||||
updateTunerStudioState();
|
||||
tsChannel->assertPacketSize(count, false);
|
||||
|
|
|
@ -102,6 +102,8 @@ void writeFileHeader(Writer& outBuffer) {
|
|||
|
||||
static uint8_t blockRollCounter = 0;
|
||||
|
||||
//static efitimeus_t prevSdCardLineTime = 0;
|
||||
|
||||
size_t writeBlock(char* buffer) {
|
||||
// Offset 0 = Block type, standard data block in this case
|
||||
buffer[0] = 0;
|
||||
|
@ -110,10 +112,14 @@ size_t writeBlock(char* buffer) {
|
|||
buffer[1] = blockRollCounter++;
|
||||
|
||||
// Offset 2, size 2 = Timestamp at 10us resolution
|
||||
uint16_t timestamp = getTimeNowUs() / 10;
|
||||
efitimeus_t nowUs = getTimeNowUs();
|
||||
uint16_t timestamp = nowUs / 10;
|
||||
buffer[2] = timestamp >> 8;
|
||||
buffer[3] = timestamp & 0xFF;
|
||||
|
||||
// todo: add a log field for SD card period
|
||||
// prevSdCardLineTime = nowUs;
|
||||
|
||||
packedTime = getTimeNowMs() * 1.0 / TIME_PRECISION;
|
||||
|
||||
// Offset 4 = field data
|
||||
|
|
Loading…
Reference in New Issue