From 8d9d032a981787ed0dc8cd601afd21ac5a5b72d3 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 13 Feb 2016 15:03:37 -0500 Subject: [PATCH] auto-sync --- firmware/controllers/algo/rusefi_enums.h | 2 +- firmware/controllers/idle_thread.cpp | 5 +++++ .../io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java | 5 ++++- .../io/src/com/rusefi/io/serial/SerialPortReader.java | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index da76da84f6..a1e0f79d95 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -575,7 +575,7 @@ typedef enum { ALTERNATOR = 0, TPS_ACCEL = 1, WARMUP_ENRICH = 2, - mode3 = 3, + IDLE = 3, Force_4b_debug_mode_e = ENUM_32_BITS, } debug_mode_e; diff --git a/firmware/controllers/idle_thread.cpp b/firmware/controllers/idle_thread.cpp index 2f8a9b54d2..97805a5ea4 100644 --- a/firmware/controllers/idle_thread.cpp +++ b/firmware/controllers/idle_thread.cpp @@ -39,6 +39,7 @@ static THD_WORKING_AREA(ivThreadStack, UTILITY_THREAD_STACK_SIZE); static Logging *logger; +extern TunerStudioOutputChannels tsOutputChannels; EXTERN_ENGINE ; @@ -112,6 +113,10 @@ static void manualIdleController(int positionPercent) { } actualIdlePosition = cltCorrectedPosition; + if (engineConfiguration->debugMode == IDLE) { + tsOutputChannels.debugFloatField1 = actualIdlePosition; + } + if (boardConfiguration->useStepperIdle) { iacMotor.setTargetPosition(cltCorrectedPosition / 100 * engineConfiguration->idleStepperTotalSteps); } else { diff --git a/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java b/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java index 7ad6d48b36..30da2cc517 100644 --- a/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java +++ b/java_console/io/src/com/rusefi/binaryprotocol/IncomingDataBuffer.java @@ -6,6 +6,7 @@ import etch.util.CircularByteBuffer; import net.jcip.annotations.ThreadSafe; import java.io.EOFException; +import java.util.Arrays; /** * (c) Andrey Belomutskiy @@ -59,7 +60,9 @@ public class IncomingDataBuffer { int pending = cbb.length(); if (pending > 0) { logger.error("Unexpected pending data: " + pending + " byte(s)"); - cbb.get(new byte[pending]); + byte[] bytes = new byte[pending]; + cbb.get(bytes); + logger.error("data: " + Arrays.toString(bytes)); } } } diff --git a/java_console/io/src/com/rusefi/io/serial/SerialPortReader.java b/java_console/io/src/com/rusefi/io/serial/SerialPortReader.java index ec46cdb9b7..d27b904f51 100644 --- a/java_console/io/src/com/rusefi/io/serial/SerialPortReader.java +++ b/java_console/io/src/com/rusefi/io/serial/SerialPortReader.java @@ -40,4 +40,8 @@ public class SerialPortReader implements SerialPortEventListener { } } + public void readInitial() throws SerialPortException { + int input = serialPort.getInputBufferBytesCount(); + FileLog.MAIN.logLine(input + " bytes in input buffer"); + } }