diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-01-02 17:01:03 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-01-02 17:01:03 +0300 |
commit | 0ba75611557cdf96f450a31bc6cd73f855523813 (patch) | |
tree | 31303c905bb143b4e68f8c2d65a173cee9c1a6c1 /src/CAN | |
parent | c726c1ddbf4c6079b913d98a4bec15a239775bd4 (diff) |
Fixes to expansion mode
Diffstat (limited to 'src/CAN')
-rw-r--r-- | src/CAN/CommandProcessor.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/CAN/CommandProcessor.cpp b/src/CAN/CommandProcessor.cpp index c7d78700..f4acf717 100644 --- a/src/CAN/CommandProcessor.cpp +++ b/src/CAN/CommandProcessor.cpp @@ -282,7 +282,7 @@ static void HandleInputStateChanged(const CanMessageInputChanged& msg, CanAddres static GCodeResult EutGetInfo(const CanMessageReturnInfo& msg, const StringRef& reply, uint8_t& extra) { - static constexpr uint8_t LastDiagnosticsPart = 2; // the last diagnostics part is typeDiagnosticsPart0 + 7 + static constexpr uint8_t LastDiagnosticsPart = 8; // the last diagnostics part is typeDiagnosticsPart0 + 8 switch (msg.type) { @@ -326,10 +326,16 @@ static GCodeResult EutGetInfo(const CanMessageReturnInfo& msg, const StringRef& break; case CanMessageReturnInfo::typeDiagnosticsPart0 + 1: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 2: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 3: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 4: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 5: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 6: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 7: + // We send each driver status in a separate message because we can't fit more than three in one reply extra = LastDiagnosticsPart; - for (size_t driver = 0; driver < NumDirectDrivers; ++driver) { - + const size_t driver = msg.type - (CanMessageReturnInfo::typeDiagnosticsPart0 + 1); reply.lcatf("Driver %u: position %" PRIi32 ", %.1f steps/mm" #if HAS_SMART_DRIVERS ", " @@ -341,7 +347,7 @@ static GCodeResult EutGetInfo(const CanMessageReturnInfo& msg, const StringRef& } break; - case CanMessageReturnInfo::typeDiagnosticsPart0 + 2: + case CanMessageReturnInfo::typeDiagnosticsPart0 + 8: extra = LastDiagnosticsPart; { #if HAS_VOLTAGE_MONITOR && HAS_12V_MONITOR |