File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -2851,6 +2851,19 @@ void Platform::DisableAllDrives()
28512851 }
28522852}
28532853
2854+ // Check if at least one driver is NOT in state disabled
2855+ bool Platform::IsAnyDriverActive () const
2856+ {
2857+ for (size_t driver = 0 ; driver < DRIVES; ++driver)
2858+ {
2859+ if (driverState[driver] != DriverStatus::disabled)
2860+ {
2861+ return true ;
2862+ }
2863+ }
2864+ return false ;
2865+ }
2866+
28542867// Set drives to idle hold if they are enabled. If a drive is disabled, leave it alone.
28552868// Must not be called from an ISR, or with interrupts disabled.
28562869void Platform::SetDriversIdle ()
@@ -4165,10 +4178,11 @@ float Platform::GetCurrentPowerVoltage() const
41654178// TMC driver temperatures
41664179float Platform::GetTmcDriversTemperature (unsigned int board) const
41674180{
4168- const uint16_t mask = ((1u << 5 ) - 1 ) << (5 * board); // there are 5 driver son each board
4181+ const uint16_t mask = ((1u << 5 ) - 1 ) << (5 * board); // there are 5 drivers on each board
41694182 return ((temperatureShutdownDrivers & mask) != 0 ) ? 150.0
41704183 : ((temperatureWarningDrivers & mask) != 0 ) ? 100.0
4171- : 0.0 ;
4184+ : IsAnyDriverActive () ? 50.0
4185+ : 0.0 ;
41724186}
41734187
41744188#endif
Original file line number Diff line number Diff line change @@ -407,6 +407,7 @@ class Platform
407407 void EnableDrive (size_t axisOrExtruder);
408408 void DisableDrive (size_t axisOrExtruder);
409409 void DisableAllDrives ();
410+ bool IsAnyDriverActive () const ;
410411 void SetDriversIdle ();
411412 void SetMotorCurrent (size_t axisOrExtruder, float current, int code);
412413 float GetMotorCurrent (size_t axisOrExtruder, int code) const ;
You can’t perform that action at this time.
0 commit comments