SD card logs not valid for REO #1864

This commit is contained in:
rusefi 2020-10-08 17:50:43 -04:00
parent 53c001d541
commit a2f3ee8d06
2 changed files with 11 additions and 1 deletions

View File

@ -196,7 +196,7 @@ typedef struct {
// we want a hash of engineMake+engineCode+vehicleName in the log file in order to match TS logs to rusEFI Online tune
int16_t engineMakeCodeNameCrc16; // 138
// Errors
int totalTriggerErrorCounter; // 140
scaled_channel<uint32_t> totalTriggerErrorCounter; // 140
int orderingErrorCounter; // 144
int16_t warningCounter; // 148
int16_t lastErrorCode; // 150

View File

@ -10,8 +10,16 @@
#include "efitime.h"
#include "crc.h"
#define TIME_PRECISION 1000
// floating number of seconds with millisecond precision
scaled_channel<uint32_t, TIME_PRECISION> packedTime;
static const LogField fields[] = {
{tsOutputChannels.rpm, GAUGE_NAME_RPM, "rpm", 0},
{packedTime, GAUGE_NAME_TIME, "sec", 0},
{tsOutputChannels.totalTriggerErrorCounter, GAUGE_NAME_TRG_ERR, "err", 0},
{tsOutputChannels.vehicleSpeedKph, GAUGE_NAME_VVS, "kph", 0},
{tsOutputChannels.internalMcuTemperature, GAUGE_NAME_CPU_TEMP, "C", 0},
{tsOutputChannels.coolantTemperature, GAUGE_NAME_CLT, "C", 1},
@ -108,6 +116,8 @@ size_t writeBlock(char* buffer) {
buffer[2] = timestamp >> 8;
buffer[3] = timestamp & 0xFF;
packedTime = currentTimeMillis() * 1.0 / TIME_PRECISION;
// Offset 4 = field data
const char* dataBlockStart = buffer + 4;
char* dataBlock = buffer + 4;