USB mass storage tweaking (#2352)
* disable TS in case of USB MSD * housekeeping while we're here * enable on MRE * changelog
This commit is contained in:
parent
bb5ee69f29
commit
187c4d00f7
|
@ -28,6 +28,7 @@ All notable user-facing or behavior-altering changes will be documented in this
|
||||||
## XXX 2021 Release
|
## XXX 2021 Release
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- USB Mass Storage: The connected SD card will be mounted over USB if rusEFI connected to a PC via USB.
|
||||||
- GM 60/2/2/2 trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#gm
|
- GM 60/2/2/2 trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#gm
|
||||||
- TriTach trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#tritach
|
- TriTach trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#tritach
|
||||||
- Skoda Favorit trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#skoda-favorit
|
- Skoda Favorit trigger https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#skoda-favorit
|
||||||
|
|
|
@ -30,6 +30,9 @@ EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOB_10 -DEFI_CONSOLE_RX_BRAI
|
||||||
# Add them all together
|
# Add them all together
|
||||||
DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"microRusEFI\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(EFI_CONSOLE_TTL_PINS) -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
DDEFS += -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"microRusEFI\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(EFI_CONSOLE_TTL_PINS) -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
||||||
|
|
||||||
|
# USB mass storage support
|
||||||
|
DDEFS += -DHAL_USE_COMMUNITY=TRUE -DHAL_USE_USB_MSD=TRUE
|
||||||
|
|
||||||
# We are running on microRusEFI hardware!
|
# We are running on microRusEFI hardware!
|
||||||
DDEFS += -DHW_MICRO_RUSEFI=1
|
DDEFS += -DHW_MICRO_RUSEFI=1
|
||||||
|
|
||||||
|
|
|
@ -738,14 +738,15 @@ int TunerStudioBase::handleCrcCommand(ts_channel_s *tsChannel, char *data, int i
|
||||||
case TS_GET_FIRMWARE_VERSION:
|
case TS_GET_FIRMWARE_VERSION:
|
||||||
handleGetVersion(tsChannel);
|
handleGetVersion(tsChannel);
|
||||||
break;
|
break;
|
||||||
#if EFI_FILE_LOGGING || EFI_SIMULATOR
|
#if (EFI_FILE_LOGGING && !HAL_USE_USB_MSD) || EFI_SIMULATOR
|
||||||
|
// This is only enabled on ECUs without USB mass storage
|
||||||
case TS_SD_R_COMMAND:
|
case TS_SD_R_COMMAND:
|
||||||
handleTsR(tsChannel, data);
|
handleTsR(tsChannel, data);
|
||||||
break;
|
break;
|
||||||
case TS_SD_W_COMMAND:
|
case TS_SD_W_COMMAND:
|
||||||
handleTsW(tsChannel, data);
|
handleTsW(tsChannel, data);
|
||||||
break;
|
break;
|
||||||
#endif //EFI_FILE_LOGGING
|
#endif // (EFI_FILE_LOGGING && !HAL_USE_USB_MSD)
|
||||||
case TS_GET_TEXT:
|
case TS_GET_TEXT:
|
||||||
handleGetText(tsChannel);
|
handleGetText(tsChannel);
|
||||||
break;
|
break;
|
||||||
|
@ -879,6 +880,7 @@ int TunerStudioBase::handleCrcCommand(ts_channel_s *tsChannel, char *data, int i
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
sendErrorCode(tsChannel, TS_RESPONSE_UNRECOGNIZED_COMMAND);
|
||||||
tunerStudioError("ERROR: ignoring unexpected command");
|
tunerStudioError("ERROR: ignoring unexpected command");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,15 +199,20 @@ static void incLogFileName(void) {
|
||||||
static void prepareLogFileName(void) {
|
static void prepareLogFileName(void) {
|
||||||
strcpy(logName, RUSEFI_LOG_PREFIX);
|
strcpy(logName, RUSEFI_LOG_PREFIX);
|
||||||
char *ptr;
|
char *ptr;
|
||||||
/* TS SD protocol supports only short 8 symbol file names :(
|
|
||||||
|
|
||||||
|
#if HAL_USE_USB_MSD
|
||||||
bool result = dateToStringShort(&logName[PREFIX_LEN]);
|
bool result = dateToStringShort(&logName[PREFIX_LEN]);
|
||||||
|
#else
|
||||||
|
// TS SD protocol supports only short 8 symbol file names :(
|
||||||
|
bool result = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
ptr = &logName[PREFIX_LEN + SHORT_TIME_LEN];
|
ptr = &logName[PREFIX_LEN + SHORT_TIME_LEN];
|
||||||
} else {
|
} else {
|
||||||
*/
|
|
||||||
ptr = itoa10(&logName[PREFIX_LEN], logFileIndex);
|
ptr = itoa10(&logName[PREFIX_LEN], logFileIndex);
|
||||||
// }
|
}
|
||||||
|
|
||||||
strcat(ptr, DOT_MLG);
|
strcat(ptr, DOT_MLG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,8 @@ bool isLogFile(const char *fileName) {
|
||||||
}
|
}
|
||||||
#endif // EFI_FILE_LOGGING || EFI_SIMULATOR || EFI_UNIT_TEST
|
#endif // EFI_FILE_LOGGING || EFI_SIMULATOR || EFI_UNIT_TEST
|
||||||
|
|
||||||
#if EFI_FILE_LOGGING || EFI_SIMULATOR
|
// Enable when logging is enabled, but not USB mass storage
|
||||||
|
#if (EFI_FILE_LOGGING && !HAL_USE_USB_MSD) || EFI_SIMULATOR
|
||||||
#include "mmc_card.h"
|
#include "mmc_card.h"
|
||||||
|
|
||||||
#if EFI_SIMULATOR
|
#if EFI_SIMULATOR
|
||||||
|
@ -378,4 +379,4 @@ void handleTsW(ts_channel_s *tsChannel, char *input) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EFI_FILE_LOGGING
|
#endif // (EFI_FILE_LOGGING && !HAL_USE_USB_MSD)
|
||||||
|
|
Loading…
Reference in New Issue