ECU firmware knows what sort of bootloader it has

This commit is contained in:
Matthew Kennedy 2023-11-02 15:36:52 -07:00
parent b2ce3379c7
commit cda890a5eb
2 changed files with 15 additions and 1 deletions

View File

@ -296,7 +296,8 @@ static bool isKnownCommand(char command) {
|| command == TS_GET_FIRMWARE_VERSION
|| command == TS_PERF_TRACE_BEGIN
|| command == TS_PERF_TRACE_GET_BUFFER
|| command == TS_GET_CONFIG_ERROR;
|| command == TS_GET_CONFIG_ERROR
|| command == TS_QUERY_BOOTLOADER;
}
/**
@ -722,6 +723,15 @@ int TunerStudio::handleCrcCommand(TsChannelBase* tsChannel, char *data, int inco
tsChannel->sendResponse(TS_CRC, reinterpret_cast<const uint8_t*>(configError), strlen(configError), true);
break;
}
case TS_QUERY_BOOTLOADER: {
uint8_t bldata = TS_QUERY_BOOTLOADER_NONE;
#if EFI_USE_OPENBLT
bldata = TS_QUERY_BOOTLOADER_OPENBLT;
#endif
tsChannel->sendResponse(TS_CRC, &bldata, 1, false);
break;
}
default:
sendErrorCode(tsChannel, TS_RESPONSE_UNRECOGNIZED_COMMAND);
static char tsErrorBuff[80];

View File

@ -1854,6 +1854,10 @@ end_struct
! 0x45
#define TS_EXECUTE 'E'
#define TS_ONLINE_PROTOCOL 'z'
#define TS_QUERY_BOOTLOADER 'L'
#define TS_QUERY_BOOTLOADER_NONE 0
#define TS_QUERY_BOOTLOADER_OPENBLT 1
! Performance tracing
#define TS_PERF_TRACE_BEGIN '_'