From bab47b6dac88b3ce0de9a15fb2557a9e9fd8e8d9 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Fri, 19 Aug 2022 16:32:13 +0100 Subject: Added missing newline in warning message --- src/GCodes/GCodeBuffer/StringParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GCodes/GCodeBuffer/StringParser.cpp b/src/GCodes/GCodeBuffer/StringParser.cpp index bd8b2c74..75113d42 100644 --- a/src/GCodes/GCodeBuffer/StringParser.cpp +++ b/src/GCodes/GCodeBuffer/StringParser.cpp @@ -433,7 +433,7 @@ void StringParser::CheckForMixedSpacesAndTabs() noexcept if (seenMetaCommand && !warnedAboutMixedSpacesAndTabs && seenLeadingSpace && seenLeadingTab) { reprap.GetPlatform().MessageF(AddWarning(gb.GetResponseMessageType()), - "both space and tab characters used to indent blocks by line %" PRIu32, gb.GetLineNumber()); + "both space and tab characters used to indent blocks at/before line %" PRIu32 "\n", gb.GetLineNumber()); warnedAboutMixedSpacesAndTabs = true; } } -- cgit v1.2.3 From 0ef799622ab2483aa248fa04bef26af002b4e79c Mon Sep 17 00:00:00 2001 From: David Crocker Date: Tue, 30 Aug 2022 10:06:24 +0100 Subject: Increased version to 3.4.2rc3 --- src/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Version.h b/src/Version.h index a174fe63..44414953 100644 --- a/src/Version.h +++ b/src/Version.h @@ -10,7 +10,7 @@ #ifndef VERSION // Note: the complete VERSION string must be in standard version number format and must not contain spaces! This is so that DWC can parse it. -# define MAIN_VERSION "3.4.2rc2+" +# define MAIN_VERSION "3.4.2rc3" # ifdef USE_CAN0 # define VERSION_SUFFIX "(CAN0)" # else -- cgit v1.2.3 From 20f3d6cd93a4dbf22414a317f27f7463b69805cd Mon Sep 17 00:00:00 2001 From: David Crocker Date: Sat, 27 Aug 2022 14:38:30 +0100 Subject: Support M917 on MB6XD --- src/GCodes/GCodes2.cpp | 4 ++-- src/Platform/Platform.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index cb416160..d807702a 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -4268,7 +4268,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx case 906: // Set/report Motor currents case 913: // Set/report motor current percent -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION case 917: // Set/report standstill motor current percentage #endif { @@ -4329,7 +4329,7 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx else { reply.copy( (code == 913) ? "Motor current % of normal - " -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION : (code == 917) ? "Motor standstill current % of normal - " #endif : "Motor current (mA) - " diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index 966906b5..e0331947 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -2666,7 +2666,7 @@ GCodeResult Platform::SetMotorCurrent(size_t axisOrExtruder, float currentOrPerc motorCurrentFraction[axisOrExtruder] = constrain(0.01 * currentOrPercent, 0.0, 1.0); break; -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION case 917: standstillCurrentPercent[axisOrExtruder] = constrain(currentOrPercent, 0.0, 100.0); break; -- cgit v1.2.3 From ea2ec7a30cb254d435bcc1912c81ff57991ee650 Mon Sep 17 00:00:00 2001 From: rechrtb Date: Tue, 30 Aug 2022 20:13:12 +0800 Subject: Increase timeouts for 8266 rtos-based firmware --- src/Networking/ESP8266WiFi/WiFiInterface.cpp | 27 +++++++++++++++++++++++---- src/Networking/ESP8266WiFi/WiFiInterface.h | 2 ++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp index 50c50f62..a990e15e 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp +++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp @@ -93,10 +93,9 @@ constexpr SSPChannel ESP_SPI = SSP0; # include "matrix/matrix.h" #endif -const uint32_t WiFiResponseTimeoutMillis = 200; // SPI timeout when when the ESP does not have to write to flash memory -const uint32_t WiFiTransferTimeoutMillis = 60; // Christian measured this at 29 to 31ms when the ESP has to write to flash memory +const uint32_t WiFiResponseTimeoutMillis = 500; // Timeout includes time-intensive flash-access operations; highest measured is 234 ms. const uint32_t WiFiWaitReadyMillis = 100; -const uint32_t WiFiStartupMillis = 300; +const uint32_t WiFiStartupMillis = 8000; const uint32_t WiFiStableMillis = 100; const unsigned int MaxHttpConnections = 4; @@ -577,6 +576,8 @@ void WiFiInterface::Start() noexcept transferAlreadyPendingCount = readyTimeoutCount = responseTimeoutCount = 0; lastTickMillis = millis(); + lastState = 0; + risingEdges = 0; SetState(NetworkState::starting1); } @@ -613,13 +614,31 @@ void WiFiInterface::Spin() noexcept { case NetworkState::starting1: { + const bool currentState = digitalRead(EspDataReadyPin); + if (currentState != lastState) + { + if (currentState) + { + risingEdges++; + } + lastState = currentState; + } + // The ESP toggles CS before it has finished starting up, so don't look at the CS signal too soon const uint32_t now = millis(); - if (now - lastTickMillis >= WiFiStartupMillis) + if (risingEdges >= 2) // the first rising edge is the one coming out of reset { lastTickMillis = now; SetState(NetworkState::starting2); } + else + { + if (now - lastTickMillis >= WiFiStartupMillis) // time wait expired + { + platform.Message(NetworkInfoMessage, "WiFi module disabled - start timed out\n"); + SetState(NetworkState::disabled); + } + } } break; diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.h b/src/Networking/ESP8266WiFi/WiFiInterface.h index 18fac5bc..3512019a 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.h +++ b/src/Networking/ESP8266WiFi/WiFiInterface.h @@ -120,6 +120,8 @@ private: Platform& platform; uint32_t lastTickMillis; + bool lastState; + int risingEdges; struct MessageBufferOut { -- cgit v1.2.3 From 5d0c6ce9ee169a9371d06ef1bbe73c678314a846 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Tue, 30 Aug 2022 13:28:17 +0100 Subject: Fixes for M917 on MB6XD --- src/Config/Pins_Duet3_MB6XD.h | 2 ++ src/Platform/Platform.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Config/Pins_Duet3_MB6XD.h b/src/Config/Pins_Duet3_MB6XD.h index 6d597b01..c8a296e4 100644 --- a/src/Config/Pins_Duet3_MB6XD.h +++ b/src/Config/Pins_Duet3_MB6XD.h @@ -113,6 +113,8 @@ constexpr GpioPinFunction StepGatePinFunction = GpioPinFunction::C; // TIOB11 #define STEP_GATE_TC_ID (ID_TC11) // ID for peripheral clock and interrupt #define STEP_GATE_TC_CHAN (2) +constexpr uint32_t DefaultStandstillCurrentPercent = 71; // needed to support expansion boards + // Thermistor/PT1000 inputs constexpr Pin TEMP_SENSE_PINS[NumThermistorInputs] = { PortCPin(15), PortCPin(29), PortCPin(0), PortCPin(31) }; // Thermistor/PT1000 pins constexpr Pin VssaSensePin = PortCPin(13); diff --git a/src/Platform/Platform.cpp b/src/Platform/Platform.cpp index e0331947..9c392fb1 100644 --- a/src/Platform/Platform.cpp +++ b/src/Platform/Platform.cpp @@ -659,7 +659,7 @@ void Platform::Init() noexcept driveDriverBits[drive] = 0; motorCurrents[drive] = 0.0; motorCurrentFraction[drive] = 1.0; -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION standstillCurrentPercent[drive] = DefaultStandstillCurrentPercent; #endif microstepping[drive] = 16 | 0x8000; // x16 with interpolation @@ -2848,7 +2848,7 @@ int Platform::GetMotorCurrent(size_t drive, int code) const noexcept rslt = motorCurrentFraction[drive] * 100.0; break; -#if HAS_SMART_DRIVERS +#if HAS_SMART_DRIVERS || SUPPORT_CAN_EXPANSION case 917: rslt = standstillCurrentPercent[drive]; break; -- cgit v1.2.3 From d3550b3b618b16f25b70c4a2e9b74cfba4b9c7fe Mon Sep 17 00:00:00 2001 From: David Crocker Date: Tue, 30 Aug 2022 14:42:35 +0100 Subject: Changed some variable names in WiFiInterface --- src/Networking/ESP8266WiFi/WiFiInterface.cpp | 10 +++++----- src/Networking/ESP8266WiFi/WiFiInterface.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.cpp b/src/Networking/ESP8266WiFi/WiFiInterface.cpp index a990e15e..9e08438b 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.cpp +++ b/src/Networking/ESP8266WiFi/WiFiInterface.cpp @@ -576,7 +576,7 @@ void WiFiInterface::Start() noexcept transferAlreadyPendingCount = readyTimeoutCount = responseTimeoutCount = 0; lastTickMillis = millis(); - lastState = 0; + lastDataReadyPinState = 0; risingEdges = 0; SetState(NetworkState::starting1); } @@ -614,14 +614,14 @@ void WiFiInterface::Spin() noexcept { case NetworkState::starting1: { - const bool currentState = digitalRead(EspDataReadyPin); - if (currentState != lastState) + const bool currentDataReadyPinState = digitalRead(EspDataReadyPin); + if (currentDataReadyPinState != lastDataReadyPinState) { - if (currentState) + if (currentDataReadyPinState && risingEdges < 10) { risingEdges++; } - lastState = currentState; + lastDataReadyPinState = currentDataReadyPinState; } // The ESP toggles CS before it has finished starting up, so don't look at the CS signal too soon diff --git a/src/Networking/ESP8266WiFi/WiFiInterface.h b/src/Networking/ESP8266WiFi/WiFiInterface.h index 3512019a..5776f1e6 100644 --- a/src/Networking/ESP8266WiFi/WiFiInterface.h +++ b/src/Networking/ESP8266WiFi/WiFiInterface.h @@ -120,8 +120,8 @@ private: Platform& platform; uint32_t lastTickMillis; - bool lastState; - int risingEdges; + bool lastDataReadyPinState; + uint8_t risingEdges; struct MessageBufferOut { -- cgit v1.2.3