auto-sync
This commit is contained in:
parent
ee444e15ea
commit
85cb89da1a
|
@ -109,7 +109,7 @@ ts_channel_s tsChannel;
|
|||
extern uint8_t crcWriteBuffer[300];
|
||||
|
||||
static int ts_serial_ready(bool isConsoleRedirect) {
|
||||
#if EFI_PROD_CODE
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
if (isSerialOverUart() ^ isConsoleRedirect) {
|
||||
// TS uses USB when console uses serial
|
||||
return is_usb_serial_ready();
|
||||
|
@ -145,7 +145,7 @@ static void printErrorCounters(void) {
|
|||
}
|
||||
|
||||
void printTsStats(void) {
|
||||
#if EFI_PROD_CODE
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
if (!isSerialOverUart()) {
|
||||
scheduleMsg(&tsLogger, "TS RX on %s", hwPortname(engineConfiguration->binarySerialRxPin));
|
||||
|
||||
|
@ -178,7 +178,7 @@ static void setTsSpeed(int value) {
|
|||
}
|
||||
|
||||
void tunerStudioDebug(const char *msg) {
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
scheduleMsg(&tsLogger, "%s", msg);
|
||||
#endif
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ void handleWriteValueCommand(ts_channel_s *tsChannel, ts_response_format_e mode,
|
|||
|
||||
tunerStudioDebug("got W (Write)"); // we can get a lot of these
|
||||
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
// scheduleMsg(logger, "Page number %d\r\n", pageId); // we can get a lot of these
|
||||
#endif
|
||||
|
||||
|
@ -337,7 +337,7 @@ void handlePageReadCommand(ts_channel_s *tsChannel, ts_response_format_e mode, u
|
|||
tsState.readPageCommandsCounter++;
|
||||
currentPageId = pageId;
|
||||
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
scheduleMsg(&tsLogger, "READ mode=%d page=%d offset=%d size=%d", mode, (int) currentPageId, offset, count);
|
||||
#endif
|
||||
|
||||
|
@ -358,13 +358,13 @@ void handlePageReadCommand(ts_channel_s *tsChannel, ts_response_format_e mode, u
|
|||
|
||||
const uint8_t *addr = (const uint8_t *) (getWorkingPageAddr(currentPageId) + offset);
|
||||
tsSendResponse(tsChannel, mode, addr, count);
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
// scheduleMsg(&tsLogger, "Sending %d done", count);
|
||||
#endif
|
||||
}
|
||||
|
||||
void requestBurn(void) {
|
||||
#if EFI_INTERNAL_FLASH
|
||||
#if EFI_INTERNAL_FLASH || defined(__DOXYGEN__)
|
||||
setNeedToWriteConfiguration();
|
||||
#endif
|
||||
incrementGlobalConfigurationVersion();
|
||||
|
@ -387,7 +387,7 @@ void handleBurnCommand(ts_channel_s *tsChannel, ts_response_format_e mode, uint1
|
|||
|
||||
currentPageId = page;
|
||||
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
// pointless since we only have one page now
|
||||
// scheduleMsg(logger, "Page number %d", currentPageId);
|
||||
#endif
|
||||
|
@ -563,7 +563,7 @@ void tunerStudioError(const char *msg) {
|
|||
*/
|
||||
void handleQueryCommand(ts_channel_s *tsChannel, ts_response_format_e mode) {
|
||||
tsState.queryCommandCounter++;
|
||||
#if EFI_TUNER_STUDIO_VERBOSE
|
||||
#if EFI_TUNER_STUDIO_VERBOSE || defined(__DOXYGEN__)
|
||||
scheduleMsg(&tsLogger, "got S/H (queryCommand) mode=%d", mode);
|
||||
printTsStats();
|
||||
#endif
|
||||
|
@ -755,8 +755,9 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin
|
|||
uint16_t subsystem = SWAP_UINT16(*(short*)&data[0]);
|
||||
uint16_t index = SWAP_UINT16(*(short*)&data[2]);
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
runIoTest(subsystem, index);
|
||||
|
||||
#endif
|
||||
} else {
|
||||
tunerStudioError("ERROR: ignoring unexpected command");
|
||||
return false;
|
||||
|
|
|
@ -132,6 +132,16 @@ static void pinbench(const char *delayStr, const char *onTimeStr, const char *of
|
|||
needToRunBench = true;
|
||||
}
|
||||
|
||||
static void doRunFuel(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
||||
const char *countStr) {
|
||||
if (humanIndex < 1 || humanIndex > engineConfiguration->specs.cylindersCount) {
|
||||
scheduleMsg(logger, "Invalid index: %d", humanIndex);
|
||||
return;
|
||||
}
|
||||
brain_pin_e b = boardConfiguration->injectionPins[humanIndex - 1];
|
||||
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.injectors[humanIndex - 1], b);
|
||||
}
|
||||
|
||||
/**
|
||||
* delay 100, cylinder #2, 5ms ON, 1000ms OFF, repeat 2 times
|
||||
* fuelbench2 100 2 5 1000 2
|
||||
|
@ -139,12 +149,7 @@ static void pinbench(const char *delayStr, const char *onTimeStr, const char *of
|
|||
static void fuelbench2(const char *delayStr, const char *indexStr, const char * onTimeStr, const char *offTimeStr,
|
||||
const char *countStr) {
|
||||
int index = atoi(indexStr);
|
||||
if (index < 1 || index > engineConfiguration->specs.cylindersCount) {
|
||||
scheduleMsg(logger, "Invalid index: %d", index);
|
||||
return;
|
||||
}
|
||||
brain_pin_e b = boardConfiguration->injectionPins[index - 1];
|
||||
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.injectors[index - 1], b);
|
||||
doRunFuel(index, delayStr, onTimeStr, offTimeStr, countStr);
|
||||
}
|
||||
|
||||
void fanBench(void) {
|
||||
|
@ -170,18 +175,24 @@ static void fuelbench(const char * onTimeStr, const char *offTimeStr, const char
|
|||
fuelbench2("0", "1", onTimeStr, offTimeStr, countStr);
|
||||
}
|
||||
|
||||
|
||||
static void doRunSpark(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr,
|
||||
const char *countStr) {
|
||||
if (humanIndex < 1 || humanIndex > engineConfiguration->specs.cylindersCount) {
|
||||
scheduleMsg(logger, "Invalid index: %d", humanIndex);
|
||||
return;
|
||||
}
|
||||
brain_pin_e b = boardConfiguration->ignitionPins[humanIndex - 1];
|
||||
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.coils[humanIndex - 1], b);
|
||||
}
|
||||
|
||||
/**
|
||||
* sparkbench2 0 1 5 1000 2
|
||||
*/
|
||||
static void sparkbench2(const char *delayStr, const char *indexStr, const char * onTimeStr, const char *offTimeStr,
|
||||
const char *countStr) {
|
||||
int index = atoi(indexStr);
|
||||
if (index < 1 || index > engineConfiguration->specs.cylindersCount) {
|
||||
scheduleMsg(logger, "Invalid index: %d", index);
|
||||
return;
|
||||
}
|
||||
brain_pin_e b = boardConfiguration->ignitionPins[index - 1];
|
||||
pinbench(delayStr, onTimeStr, offTimeStr, countStr, &enginePins.coils[index - 1], b);
|
||||
doRunSpark(index, delayStr, onTimeStr, offTimeStr, countStr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -265,6 +276,12 @@ void startInjectionPins(void) {
|
|||
void runIoTest(int subsystem, int index) {
|
||||
scheduleMsg(logger, "IO test subsystem=%d index=%d", subsystem, index);
|
||||
|
||||
if (subsystem == 0x12) {
|
||||
doRunSpark(index, "300", "4", "400", "3");
|
||||
} else if (subsystem == 0x13) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void initInjectorCentral(Logging *sharedLogger) {
|
||||
|
|
|
@ -1235,22 +1235,41 @@ fileVersion = { 20160122 }
|
|||
; and may create error messages.
|
||||
; It is expected that these commands would not typically alter any ram mapped to a Constant.
|
||||
|
||||
cmd_test_spk1 = "w\x00\x12\x00\x00"
|
||||
cmd_test_spk2 = "w\x00\x12\x00\x01"
|
||||
cmd_test_spk3 = "w\x00\x12\x00\x02"
|
||||
cmd_test_spk4 = "w\x00\x12\x00\x03"
|
||||
cmd_test_spk5 = "w\x00\x12\x00\x04"
|
||||
cmd_test_spk6 = "w\x00\x12\x00\x05"
|
||||
cmd_test_spk7 = "w\x00\x12\x00\x06"
|
||||
cmd_test_spk8 = "w\x00\x12\x00\x07"
|
||||
cmd_test_spk9 = "w\x00\x12\x00\x08"
|
||||
cmd_test_spk10 = "w\x00\x12\x00\x09"
|
||||
cmd_test_spk11 = "w\x00\x12\x00\x0a"
|
||||
cmd_test_spk12 = "w\x00\x12\x00\x0b"
|
||||
cmd_test_spk13 = "w\x00\x12\x00\x0c"
|
||||
cmd_test_spk14 = "w\x00\x12\x00\x0d"
|
||||
cmd_test_spk15 = "w\x00\x12\x00\x0e"
|
||||
cmd_test_spk16 = "w\x00\x12\x00\x0f"
|
||||
cmd_test_spk1 = "w\x00\x12\x00\x01"
|
||||
cmd_test_spk2 = "w\x00\x12\x00\x02"
|
||||
cmd_test_spk3 = "w\x00\x12\x00\x03"
|
||||
cmd_test_spk4 = "w\x00\x12\x00\x04"
|
||||
cmd_test_spk5 = "w\x00\x12\x00\x05"
|
||||
cmd_test_spk6 = "w\x00\x12\x00\x06"
|
||||
cmd_test_spk7 = "w\x00\x12\x00\x07"
|
||||
cmd_test_spk8 = "w\x00\x12\x00\x08"
|
||||
cmd_test_spk9 = "w\x00\x12\x00\x09"
|
||||
cmd_test_spk10 = "w\x00\x12\x00\x0a"
|
||||
cmd_test_spk11 = "w\x00\x12\x00\x0b"
|
||||
cmd_test_spk12 = "w\x00\x12\x00\x0c"
|
||||
cmd_test_spk13 = "w\x00\x12\x00\x0d"
|
||||
cmd_test_spk14 = "w\x00\x12\x00\x0e"
|
||||
cmd_test_spk15 = "w\x00\x12\x00\x0f"
|
||||
cmd_test_spk16 = "w\x00\x12\x00\x10"
|
||||
|
||||
|
||||
cmd_test_inj1 = "w\x00\x13\x00\x01"
|
||||
cmd_test_inj2 = "w\x00\x13\x00\x02"
|
||||
cmd_test_inj3 = "w\x00\x13\x00\x03"
|
||||
cmd_test_inj4 = "w\x00\x13\x00\x04"
|
||||
cmd_test_inj5 = "w\x00\x13\x00\x05"
|
||||
cmd_test_inj6 = "w\x00\x13\x00\x06"
|
||||
cmd_test_inj7 = "w\x00\x13\x00\x07"
|
||||
cmd_test_inj8 = "w\x00\x13\x00\x08"
|
||||
cmd_test_inj9 = "w\x00\x13\x00\x09"
|
||||
cmd_test_inj10 = "w\x00\x13\x00\x0a"
|
||||
cmd_test_inj11 = "w\x00\x13\x00\x0b"
|
||||
cmd_test_inj12 = "w\x00\x13\x00\x0c"
|
||||
cmd_test_inj13 = "w\x00\x13\x00\x0d"
|
||||
cmd_test_inj14 = "w\x00\x13\x00\x0e"
|
||||
cmd_test_inj15 = "w\x00\x13\x00\x0f"
|
||||
cmd_test_inj16 = "w\x00\x13\x00\x10"
|
||||
|
||||
|
||||
[UserDefined]
|
||||
|
||||
|
@ -1727,6 +1746,11 @@ cmd_test_spk16 = "w\x00\x12\x00\x0f"
|
|||
commandButton = "Spark #3", cmd_test_spk3
|
||||
commandButton = "Spark #4", cmd_test_spk4
|
||||
|
||||
commandButton = "Injector #1", cmd_test_inj1
|
||||
commandButton = "Injector #2", cmd_test_inj2
|
||||
commandButton = "Injector #3", cmd_test_inj3
|
||||
commandButton = "Injector #4", cmd_test_inj4
|
||||
|
||||
; Board->ECU stimulator
|
||||
dialog = ecuStimulator, "ECU stimulator"
|
||||
field = "Trigger Simulator", triggerSimulatorFrequency
|
||||
|
|
Loading…
Reference in New Issue