Skip to content
This repository was archived by the owner on Jul 9, 2020. It is now read-only.

Commit 157a303

Browse files
committed
Merge remote-tracking branch 'dc42/v3-dev' into v3-dev-lpc
2 parents eefc6c4 + 636ba17 commit 157a303

23 files changed

+197
-137
lines changed

.cproject

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
<option id="gnu.cpp.compiler.option.optimization.level.1835678360" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.more" valueType="enumerated"/>
242242
<option id="gnu.cpp.compiler.option.debugging.level.737051102" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
243243
<option id="gnu.cpp.compiler.option.other.verbose.1225557122" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
244-
<option id="gnu.cpp.compiler.option.other.other.1423466590" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fexceptions -nostdlib -Wundef -Wdouble-promotion -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
244+
<option id="gnu.cpp.compiler.option.other.other.1423466590" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib -Wundef -Wdouble-promotion -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
245245
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1505018967" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
246246
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/cores/arduino}&quot;"/>
247247
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/libraries/Flash}&quot;"/>
@@ -397,7 +397,7 @@
397397
<option id="gnu.cpp.compiler.option.optimization.level.1017091230" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.more" valueType="enumerated"/>
398398
<option id="gnu.cpp.compiler.option.debugging.level.326047343" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
399399
<option id="gnu.cpp.compiler.option.other.verbose.1316817271" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
400-
<option id="gnu.cpp.compiler.option.other.other.434744183" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fexceptions -nostdlib -Wundef -Wdouble-promotion -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
400+
<option id="gnu.cpp.compiler.option.other.other.434744183" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib -Wundef -Wdouble-promotion -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
401401
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1102345734" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
402402
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/cores/arduino}&quot;"/>
403403
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/libraries/Flash}&quot;"/>
@@ -1018,7 +1018,7 @@
10181018
<listOptionValue builtIn="false" value="__SAME70Q20B__"/>
10191019
<listOptionValue builtIn="false" value="RTOS"/>
10201020
<listOptionValue builtIn="false" value="DUET3_V05"/>
1021-
<listOptionValue builtIn="false" value="LWIP_GMAC_TASK=0"/>
1021+
<listOptionValue builtIn="false" value="LWIP_GMAC_TASK=1"/>
10221022
</option>
10231023
<option id="gnu.c.compiler.option.dialect.std.1184547155" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
10241024
<option id="gnu.c.compiler.option.dialect.flags.1834251763" name="Other dialect flags" superClass="gnu.c.compiler.option.dialect.flags" useByScannerDiscovery="true" value="-std=gnu99" valueType="string"/>
@@ -1085,7 +1085,7 @@
10851085
<listOptionValue builtIn="false" value="__SAME70Q20B__"/>
10861086
<listOptionValue builtIn="false" value="RTOS"/>
10871087
<listOptionValue builtIn="false" value="DUET3_V05"/>
1088-
<listOptionValue builtIn="false" value="LWIP_GMAC_TASK=0"/>
1088+
<listOptionValue builtIn="false" value="LWIP_GMAC_TASK=1"/>
10891089
<listOptionValue builtIn="false" value="_XOPEN_SOURCE"/>
10901090
</option>
10911091
<option id="gnu.cpp.compiler.option.dialect.std.264694574" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>

WHATS_NEW_BETA.md renamed to WHATS_NEW_RRF3.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
RepRapFirmware 3.0beta13 (in preparation)
2-
========================
1+
RepRapFirmware 3.0RC1
2+
=====================
33

44
Recommended compatible firmware:
55
- Duet Web Control 2.0.4
@@ -13,19 +13,21 @@ Feature changes since beta 12:
1313
- Max bed heaters increased to 9 on Duet 3, 2 on Duet Meastro (still 4 on Duet WiFi/Ethernet)
1414
- Max chamber heaters increased to 4 on Duet 3 and on Duet WiFi/Ethernet
1515
- CRC calculation has been speeded up, which improves the speed of file uploads in standalone mode when CRC checking is enabled in DWC
16+
- G1 H1 E moves (stopping on motor stall) are now implemented
17+
- rr_config and M408 S5 responses now include field "sysdir" which is the system files folder set using M505
18+
- M950 P, M950 S, M42 and M280 are implemented on expansion boards
19+
- B parameter added to M408 to query expansion boards (for expansion board ATE)
20+
- M122 P parameter is passed to the expansion board if the B parameter is present and selects an expansion board (for ATE)
1621

1722
Bug fixes:
1823
- Duet 3 only: Files uploaded in standalone modes were frequently corruption during uploading, resulting in CRC mismatches reported
1924
- The M574 S0 parameter was teated the same as S2 (i.e. triggered when input high) except on endstop inputs connected to Duet 3 expansion boards
2025
- If a print that was sliced using absolute extrusion mode was resurrected, unwanted extrusion occurred just before the print was resumed
2126
- Bed compensation did not take account of the XY offset of the printing nozzle from the head reference point
22-
- When using SCARA kinematics the calculation of the minimum achoievable radius was incorrect. Depending on the B parameter of the M667 command, this could result in spurious "Intermediate position unreachable" errors, or non-extruding G1 moves being turned into G0 moves.
27+
- When using SCARA kinematics the calculation of the minimum achievable radius was incorrect. Depending on the B parameter of the M667 command, this could result in spurious "Intermediate position unreachable" errors, or non-extruding G1 moves being turned into G0 moves.
2328
- A badly-formed GCode file that returned the layer height or object height as nan or inf caused DWC to disconnect because of a JSON parse failure
2429
- M579 scale factors were not applied correctly to G2 and G3 arc moves
25-
- [TO TEST] Stall detection endstops should now work when multiple axes are homed simultaneously
26-
27-
Known issues:
28-
- Extruder stall detection (G1 H1 E moves) is not implemented
30+
- M119 crashed if an axis had no endstop
2931

3032
RepRapFirmware 3.0beta12
3133
========================

src/Duet3_V05/Pins_Duet3_V05.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@
77
const size_t NumFirmwareUpdateModules = 1;
88

99
#define IAP_FIRMWARE_FILE "Duet3Firmware_" BOARD_SHORT_NAME ".bin"
10-
#define IAP_UPDATE_FILE "Duet3iap_sd_" BOARD_SHORT_NAME ".bin"
10+
11+
#define IAP_IN_RAM 1
12+
13+
#if IAP_IN_RAM
14+
# define IAP_UPDATE_FILE "Duet3_SDiap_" BOARD_SHORT_NAME ".bin"
15+
constexpr uint32_t IAP_IMAGE_START = 0x20450000; // last 64kb of RAM
16+
#else
17+
# define IAP_UPDATE_FILE "Duet3iap_sd_" BOARD_SHORT_NAME ".bin"
18+
19+
// SAME70 Flash locations
20+
// These are designed to work with 1Mbyte flash processors as well as 2Mbyte
21+
// We can only erase complete 128kb sectors on the SAME70, so we allow 128Kb for IAP
22+
constexpr uint32_t IAP_IMAGE_START = 0x004E0000;
23+
constexpr uint32_t IAP_IMAGE_END = 0x004FFFFF;
24+
#endif
1125

1226
// Features definition
1327
#define HAS_LWIP_NETWORKING 1
@@ -41,8 +55,6 @@ const size_t NumFirmwareUpdateModules = 1;
4155
#define USE_CACHE 0 // Cache controller disabled for now
4256
#define USE_MPU 1
4357

44-
#define NO_EXTRUDER_ENDSTOPS 1 // Temporary!!!
45-
4658
// The physical capabilities of the machine
4759

4860
constexpr size_t NumDirectDrivers = 6; // The maximum number of drives supported by the electronics inc. direct expansion
@@ -52,8 +64,7 @@ constexpr size_t MaxCanBoards = 18;
5264

5365
constexpr float MaxTmc5160Current = 3200.0; // The maximum current we allow the TMC5160/5161 drivers to be set to
5466

55-
constexpr size_t MaxSensorsInSystem = 64;
56-
typedef uint64_t SensorsBitmap;
67+
constexpr size_t MaxSensors = 64;
5768

5869
constexpr size_t MaxHeaters = 12;
5970
constexpr size_t MaxExtraHeaterProtections = 8; // The number of extra heater protection instances
@@ -248,12 +259,6 @@ constexpr unsigned int NumNamedPins = ARRAY_SIZE(PinTable);
248259
// Function to look up a pin name pass back the corresponding index into the pin table
249260
bool LookupPinName(const char *pn, LogicalPin& lpin, bool& hardwareInverted);
250261

251-
// SAME70 Flash locations
252-
// These are designed to work with 1Mbyte flash processors as well as 2Mbyte
253-
// We can only erase complete 128kb sectors on the SAME70, so we allow 128Kb for IAP
254-
constexpr uint32_t IAP_FLASH_START = 0x004E0000;
255-
constexpr uint32_t IAP_FLASH_END = 0x004FFFFF;
256-
257262
// Duet pin numbers for the Linux interface
258263
constexpr Pin LinuxTfrReadyPin = PortEPin(2);
259264
Spi * const LinuxSpi = SPI1;

src/Duet3_V06/Pins_Duet3_V06.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const size_t NumFirmwareUpdateModules = 1;
88

99
#define IAP_FIRMWARE_FILE "Duet3Firmware_" BOARD_SHORT_NAME ".bin"
1010

11-
#define IAP_IN_RAM 0
11+
#define IAP_IN_RAM 1
1212

1313
#if IAP_IN_RAM
14-
# define IAP_UPDATE_FILE "Duet3iap_sd_ram_" BOARD_SHORT_NAME ".bin"
14+
# define IAP_UPDATE_FILE "Duet3_SDiap_" BOARD_SHORT_NAME ".bin"
1515
constexpr uint32_t IAP_IMAGE_START = 0x20450000; // last 64kb of RAM
1616
#else
1717
# define IAP_UPDATE_FILE "Duet3iap_sd_" BOARD_SHORT_NAME ".bin"
@@ -23,7 +23,6 @@ constexpr uint32_t IAP_IMAGE_START = 0x004E0000;
2323
constexpr uint32_t IAP_IMAGE_END = 0x004FFFFF;
2424
#endif
2525

26-
2726
// Features definition
2827
#define HAS_LWIP_NETWORKING 1
2928
#define HAS_WIFI_NETWORKING 0
@@ -60,8 +59,6 @@ constexpr uint32_t IAP_IMAGE_END = 0x004FFFFF;
6059
#define USE_MPU 1 // Needed if USE_CACHE is set, so that we can have non-cacheable memory regions
6160
#define USE_CACHE 1
6261

63-
#define NO_EXTRUDER_ENDSTOPS 1 // Temporary!!!
64-
6562
// The physical capabilities of the machine
6663

6764
constexpr size_t NumDirectDrivers = 6; // The maximum number of drives supported by the electronics inc. direct expansion
@@ -71,8 +68,7 @@ constexpr size_t MaxCanBoards = 18;
7168

7269
constexpr float MaxTmc5160Current = 6300.0; // The maximum current we allow the TMC5160/5161 drivers to be set to
7370

74-
constexpr size_t MaxSensorsInSystem = 64;
75-
typedef uint64_t SensorsBitmap;
71+
constexpr size_t MaxSensors = 64;
7672

7773
constexpr size_t MaxHeaters = 12;
7874
constexpr size_t MaxExtraHeaterProtections = 8; // The number of extra heater protection instances

src/DuetM/Pins_DuetM.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,12 @@ constexpr uint32_t IAP_IMAGE_END = 0x0047FFFF; // we allow a full 64K on
5656
#define SUPPORT_ASYNC_MOVES 1
5757
#define ALLOCATE_DEFAULT_PORTS 1
5858

59-
#define NO_EXTRUDER_ENDSTOPS 1 // Temporary!!!
60-
6159
// The physical capabilities of the machine
6260

6361
constexpr size_t NumDirectDrivers = 7; // The maximum number of drives supported by the electronics
6462
constexpr size_t MaxSmartDrivers = 7; // The maximum number of smart drivers
6563

66-
constexpr size_t MaxSensorsInSystem = 32;
67-
typedef uint32_t SensorsBitmap;
64+
constexpr size_t MaxSensors = 32;
6865

6966
constexpr size_t MaxHeaters = 4; // The maximum number of heaters in the machine
7067
constexpr size_t MaxExtraHeaterProtections = 4; // The number of extra heater protection instances

src/DuetNG/Pins_DuetNG.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@ constexpr size_t NumFirmwareUpdateModules = 4; // 3 modules, plus one for manua
5454
#define USE_CACHE 1 // set nonzero to enable the cache
5555
#define USE_MPU 0 // set nonzero to enable the memory protection unit
5656

57-
#define NO_EXTRUDER_ENDSTOPS 1 // Temporary!!!
58-
5957
// The physical capabilities of the machine
6058

6159
constexpr size_t NumDirectDrivers = 12; // The maximum number of drives supported directly by the electronics
6260
constexpr size_t MaxSmartDrivers = 10; // The maximum number of smart drivers
6361

64-
constexpr size_t MaxSensorsInSystem = 32;
65-
typedef uint32_t SensorsBitmap;
62+
constexpr size_t MaxSensors = 32;
6663

6764
constexpr size_t MaxHeaters = 10; // The maximum number of heaters in the machine
6865
constexpr size_t MaxExtraHeaterProtections = 8; // The number of extra heater protection instances

src/Endstops/EndstopDefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum class EndstopHitAction : uint8_t
2626
// Struct to return info about what endstop has been triggered and what to do about it
2727
struct EndstopHitDetails
2828
{
29-
EndstopHitDetails() : action((uint32_t)EndstopHitAction::none), internalUse(0), axis(0), setAxisLow(false), setAxisHigh(false), isZProbe(false)
29+
EndstopHitDetails() : action((uint32_t)EndstopHitAction::none), internalUse(0), axis(NO_AXIS), setAxisLow(false), setAxisHigh(false), isZProbe(false)
3030
{
3131
driver.Clear();
3232
}

src/Endstops/EndstopsManager.cpp

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
ReadWriteLock EndstopsManager::endstopsLock; // used to lock both endstops and Z probes
2929

30-
EndstopsManager::EndstopsManager() : activeEndstops(nullptr), isHomingMove(false)
30+
EndstopsManager::EndstopsManager() : activeEndstops(nullptr), extrudersEndstop(nullptr), isHomingMove(false)
3131
{
3232
for (Endstop *& es : axisEndstops)
3333
{
@@ -78,21 +78,20 @@ void EndstopsManager::AddToActive(EndstopOrZProbe& e)
7878
bool EndstopsManager::EnableAxisEndstops(AxesBitmap axes, bool forHoming)
7979
{
8080
activeEndstops = nullptr;
81-
isHomingMove = forHoming;
81+
isHomingMove = forHoming && axes != 0;
8282
const Kinematics& kin = reprap.GetMove().GetKinematics();
83-
for (size_t axis = 0; axis < reprap.GetGCodes().GetVisibleAxes(); ++axis)
83+
while (axes != 0)
8484
{
85-
if (IsBitSet(axes, axis))
85+
const unsigned int axis = LowestSetBit(axes);
86+
ClearBit(axes, axis);
87+
if (axisEndstops[axis] != nullptr && axisEndstops[axis]->Prime(kin, reprap.GetPlatform().GetAxisDriversConfig(axis)))
8688
{
87-
if (axisEndstops[axis] != nullptr && axisEndstops[axis]->Prime(kin, reprap.GetPlatform().GetAxisDriversConfig(axis)))
88-
{
89-
AddToActive(*axisEndstops[axis]);
90-
}
91-
else
92-
{
93-
activeEndstops = nullptr;
94-
return false;
95-
}
89+
AddToActive(*axisEndstops[axis]);
90+
}
91+
else
92+
{
93+
activeEndstops = nullptr;
94+
return false;
9695
}
9796
}
9897
return true;
@@ -111,19 +110,44 @@ bool EndstopsManager::EnableZProbe(size_t probeNumber, bool probingAway)
111110
return true;
112111
}
113112

114-
// Enable extruder endstops
115-
bool EndstopsManager::EnableExtruderEndstop(size_t extruder)
113+
// Enable extruder endstops. This adds to any existing axis endstops, so you must call EnableAxisEndstops before calling this.
114+
bool EndstopsManager::EnableExtruderEndstops(ExtrudersBitmap extruders)
116115
{
117-
#ifdef NO_EXTRUDER_ENDSTOPS
118-
// not supported for now
119-
return false;
116+
if (extruders != 0)
117+
{
118+
if (extrudersEndstop == nullptr)
119+
{
120+
extrudersEndstop = new StallDetectionEndstop;
121+
}
122+
DriversBitmap drivers = 0;
123+
while (extruders != 0)
124+
{
125+
const unsigned int extruder = LowestSetBit(extruders);
126+
ClearBit(extruders, extruder);
127+
const DriverId driver = reprap.GetPlatform().GetExtruderDriver(extruder);
128+
#if SUPPORT_CAN_EXPANSION
129+
if (driver.IsLocal())
130+
{
131+
SetBit(drivers, driver.localDriver);
132+
}
133+
else
134+
{
135+
//TODO remote stall detect endstop
136+
return false;
137+
}
120138
#else
121-
qq; //TODO
139+
SetBit(drivers, driver.localDriver);
122140
#endif
141+
}
142+
143+
extrudersEndstop->SetDrivers(drivers);
144+
AddToActive(*extrudersEndstop);
145+
}
146+
return true;
123147
}
124148

125149
// Check the endstops.
126-
// If an endstop has triggered, remove it from the active list, return its action, and return a pointer to it via 'es'.
150+
// If an endstop has triggered, remove it from the active list and return its details
127151
EndstopHitDetails EndstopsManager::CheckEndstops(bool goingSlow)
128152
{
129153
EndstopHitDetails ret; // the default constructor will clear all fields
@@ -345,7 +369,7 @@ void EndstopsManager::GetM119report(const StringRef& reply)
345369
reply.copy("Endstops - ");
346370
for (size_t axis = 0; axis < reprap.GetGCodes().GetTotalAxes(); ++axis)
347371
{
348-
const char * const status = (axisEndstops == nullptr)
372+
const char * const status = (axisEndstops[axis] == nullptr)
349373
? "no endstop"
350374
: TranslateEndStopResult(axisEndstops[axis]->Stopped(), axisEndstops[axis]->GetAtHighEnd());
351375
reply.catf("%c: %s, ", reprap.GetGCodes().GetAxisLetters()[axis], status);
@@ -371,7 +395,7 @@ const char *EndstopsManager::TranslateEndStopResult(EndStopHit es, bool atHighEn
371395

372396
ZProbe& EndstopsManager::GetCurrentZProbe() const
373397
{
374-
ZProbe * const zp = zProbes[currentZProbeNumber];
398+
ZProbe * const zp = (currentZProbeNumber < MaxZProbes) ? zProbes[currentZProbeNumber] : nullptr;
375399
return (zp == nullptr) ? *defaultZProbe : *zp;
376400
}
377401

src/Endstops/EndstopsManager.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
class CanMessageBuffer;
1919
#endif
2020

21+
class StallDetectionEndstop;
22+
2123
// Endstop manager class
2224
class EndstopsManager
2325
{
@@ -36,7 +38,7 @@ class EndstopsManager
3638
bool EnableCurrentZProbe(bool probingAway = false) __attribute__ ((warn_unused_result)) { return EnableZProbe(currentZProbeNumber, probingAway); }
3739

3840
// Enable extruder endstops
39-
bool EnableExtruderEndstop(size_t extruder);
41+
bool EnableExtruderEndstops(ExtrudersBitmap extruders);
4042

4143
// Get the first endstop that has triggered and remove it from the active list if appropriate
4244
EndstopHitDetails CheckEndstops(bool goingSlow);
@@ -87,6 +89,7 @@ class EndstopsManager
8789
size_t currentZProbeNumber; // which Z probe we are using
8890

8991
Endstop *axisEndstops[MaxAxes]; // the endstops assigned to each axis (each one may have several switches), each may be null
92+
StallDetectionEndstop *extrudersEndstop; // the endstop used for extruder stall detection, one will do for all extruders
9093
ZProbe *zProbes[MaxZProbes]; // the Z probes used. The first one is always non-null.
9194
ZProbe *defaultZProbe;
9295

src/Endstops/StallDetectionEndstop.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ StallDetectionEndstop::StallDetectionEndstop(uint8_t axis, EndStopPosition pos,
1616
{
1717
}
1818

19+
StallDetectionEndstop::StallDetectionEndstop()
20+
: Endstop(NO_AXIS, EndStopPosition::noEndStop), driversMonitored(0), individualMotors(false), stopAll(true)
21+
{
22+
}
23+
1924
// Test whether we are at or near the stop
2025
EndStopHit StallDetectionEndstop::Stopped() const
2126
{
@@ -46,7 +51,11 @@ EndstopHitDetails StallDetectionEndstop::CheckTriggered(bool goingSlow)
4651
if (relevantStalledDrivers != 0)
4752
{
4853
rslt.axis = GetAxis();
49-
if (stopAll)
54+
if (rslt.axis == NO_AXIS)
55+
{
56+
rslt.SetAction(EndstopHitAction::stopAll);
57+
}
58+
else if (stopAll)
5059
{
5160
rslt.SetAction(EndstopHitAction::stopAll);
5261
if (GetAtHighEnd())
@@ -109,4 +118,10 @@ void StallDetectionEndstop::AppendDetails(const StringRef& str)
109118
str.cat((individualMotors) ? "motor stall (individual motors)" : "motor stall (any motor)");
110119
}
111120

121+
void StallDetectionEndstop::SetDrivers(DriversBitmap extruderDrivers)
122+
{
123+
driversMonitored = extruderDrivers;
124+
stopAll = true;
125+
}
126+
112127
// End

0 commit comments

Comments
 (0)