configurable SD card logging speed

This commit is contained in:
rusefi 2019-09-20 20:18:22 -04:00
parent 37d703f6e0
commit aa8d0eb640
6 changed files with 20 additions and 7 deletions

View File

@ -601,6 +601,8 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->canWriteEnabled = true;
engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
boardConfiguration->sdCardPeriodMs = 50;
for (int i = 0; i < FSIO_COMMAND_COUNT; i++) {
config->fsioFormulas[i][0] = 0;
}

View File

@ -819,6 +819,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190914;
return 20190919;
}
#endif /* EFI_UNIT_TEST */

View File

@ -90,7 +90,7 @@ static SPIConfig ls_spicfg = {
// don't forget check if STM32_SPI_USE_SPI2 defined and spi has init with correct GPIO in hardware.cpp
static MMCConfig mmccfg = { NULL, &ls_spicfg, &hs_spicfg };
#define FILE_LOG_DELAY 200
#define FILE_LOG_MIN_DELAY 3
/**
* fatfs MMC/SPI
@ -425,7 +425,8 @@ static THD_FUNCTION(MMCmonThread, arg) {
if (isSdCardAlive())
writeLogLine();
chThdSleepMilliseconds(FILE_LOG_DELAY);
int periodMs = maxI(boardConfiguration->sdCardPeriodMs, FILE_LOG_MIN_DELAY);
chThdSleepMilliseconds(periodMs);
}
}
@ -434,6 +435,10 @@ bool isSdCardAlive(void) {
}
void initMmcCard(void) {
// temporary value while we migrate
if (boardConfiguration->sdCardPeriodMs == 0)
boardConfiguration->sdCardPeriodMs = 50;
logName[0] = 0;
addConsoleAction("sdinfo", sdStatistics);
if (!CONFIGB(isSdCardEnabled)) {

View File

@ -636,7 +636,8 @@ pin_output_mode_e hip9011IntHoldPinMode;
custom uart_device_e 1 bits,U32, @OFFSET@, [0:1], "Off", "UART1", "UART2", "UART3"
uint8_t[4] unusedSpiPadding2;
int16_t sdCardPeriodMs;+SD card logging period, in milliseconds;"ms", 1, 0, 0, 30000, 0
uint8_t[2] unusedSpiPadding2;
uint8_t[4] unuseduartPadding1;
int mapMinBufferLength;;"count", 1, 0, 0, 24, 0

View File

@ -2167,6 +2167,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "SPI", sdCardSpiDevice
field = "log format", logFormat
field = "Mass Storage", storageMode
field = "Write Period", sdCardPeriodMs
dialog = gpsReceiver, "GPS Receiver"
field = "gps RX", gps_rx_pin

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Fri Sep 20 19:03:27 EDT 2019
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Fri Sep 20 19:43:59 EDT 2019
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -1047,6 +1047,8 @@ public class Fields {
public static final int runningLedPin_offset = 1813;
public static final int runningLedPin_offset_hex = 715;
public static final int sdCardCsPin_offset = 707;
public static final int sdCardPeriodMs_offset = 804;
public static final int sdCardPeriodMs_offset_hex = 324;
public static final int sdCardSpiDevice_offset = 2592;
public static final int secondTriggerChannelEnabled_offset = 1476;
public static final int sensorChartFrequency_offset = 520;
@ -1229,8 +1231,8 @@ public class Fields {
public static final int unusedh_offset = 1471;
public static final int unusedMa2_offset = 711;
public static final int unusedOldWarmupAfr_offset = 744;
public static final int unusedSpiPadding2_offset = 804;
public static final int unusedSpiPadding2_offset_hex = 324;
public static final int unusedSpiPadding2_offset = 806;
public static final int unusedSpiPadding2_offset_hex = 326;
public static final int unusedSpiPadding3_offset = 4036;
public static final int unusedSpiPadding4_offset = 2593;
public static final int unusedSpiPadding5_offset = 2713;
@ -1622,6 +1624,7 @@ public class Fields {
public static final Field MAX31855_CS6 = Field.create("MAX31855_CS6", 801, FieldType.INT8, brain_pin_e);
public static final Field MAX31855_CS7 = Field.create("MAX31855_CS7", 802, FieldType.INT8, brain_pin_e);
public static final Field MAX31855_CS8 = Field.create("MAX31855_CS8", 803, FieldType.INT8, brain_pin_e);
public static final Field SDCARDPERIODMS = Field.create("SDCARDPERIODMS", 804, FieldType.INT16);
public static final Field MAPMINBUFFERLENGTH = Field.create("MAPMINBUFFERLENGTH", 812, FieldType.INT);
public static final Field IDLEPIDDEACTIVATIONTPSTHRESHOLD = Field.create("IDLEPIDDEACTIVATIONTPSTHRESHOLD", 816, FieldType.INT16);
public static final Field STEPPERPARKINGEXTRASTEPS = Field.create("STEPPERPARKINGEXTRASTEPS", 818, FieldType.INT16);
@ -2403,6 +2406,7 @@ public class Fields {
MAX31855_CS6,
MAX31855_CS7,
MAX31855_CS8,
SDCARDPERIODMS,
MAPMINBUFFERLENGTH,
IDLEPIDDEACTIVATIONTPSTHRESHOLD,
STEPPERPARKINGEXTRASTEPS,