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:
Matthew Kennedy 2021-02-14 12:03:07 -08:00 committed by GitHub
parent bb5ee69f29
commit 187c4d00f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 7 deletions

View File

@ -28,6 +28,7 @@ All notable user-facing or behavior-altering changes will be documented in this
## XXX 2021 Release
### 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
- 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

View File

@ -30,6 +30,9 @@ EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOB_10 -DEFI_CONSOLE_RX_BRAI
# 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
# USB mass storage support
DDEFS += -DHAL_USE_COMMUNITY=TRUE -DHAL_USE_USB_MSD=TRUE
# We are running on microRusEFI hardware!
DDEFS += -DHW_MICRO_RUSEFI=1

View File

@ -738,14 +738,15 @@ int TunerStudioBase::handleCrcCommand(ts_channel_s *tsChannel, char *data, int i
case TS_GET_FIRMWARE_VERSION:
handleGetVersion(tsChannel);
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:
handleTsR(tsChannel, data);
break;
case TS_SD_W_COMMAND:
handleTsW(tsChannel, data);
break;
#endif //EFI_FILE_LOGGING
#endif // (EFI_FILE_LOGGING && !HAL_USE_USB_MSD)
case TS_GET_TEXT:
handleGetText(tsChannel);
break;
@ -879,6 +880,7 @@ int TunerStudioBase::handleCrcCommand(ts_channel_s *tsChannel, char *data, int i
break;
}
default:
sendErrorCode(tsChannel, TS_RESPONSE_UNRECOGNIZED_COMMAND);
tunerStudioError("ERROR: ignoring unexpected command");
return false;
}

View File

@ -199,15 +199,20 @@ static void incLogFileName(void) {
static void prepareLogFileName(void) {
strcpy(logName, RUSEFI_LOG_PREFIX);
char *ptr;
/* TS SD protocol supports only short 8 symbol file names :(
#if HAL_USE_USB_MSD
bool result = dateToStringShort(&logName[PREFIX_LEN]);
#else
// TS SD protocol supports only short 8 symbol file names :(
bool result = false;
#endif
if (result) {
ptr = &logName[PREFIX_LEN + SHORT_TIME_LEN];
} else {
*/
ptr = itoa10(&logName[PREFIX_LEN], logFileIndex);
// }
}
strcat(ptr, DOT_MLG);
}

View File

@ -54,7 +54,8 @@ bool isLogFile(const char *fileName) {
}
#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"
#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)