Fix starting fan with bad material preset index (#19773)
This commit is contained in:
		
							parent
							
								
									eaf6777a66
								
							
						
					
					
						commit
						313efa33ae
					
				| @ -44,24 +44,17 @@ | |||||||
| //
 | //
 | ||||||
| 
 | 
 | ||||||
| void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { | void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { | ||||||
|  |   UNUSED(e); UNUSED(indh); UNUSED(indb); | ||||||
|   #if HAS_HOTEND |   #if HAS_HOTEND | ||||||
|     if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) |     if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) | ||||||
|       setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e); |       setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e); | ||||||
|   #else |  | ||||||
|     UNUSED(e); UNUSED(indh); |  | ||||||
|   #endif |   #endif | ||||||
|   #if HAS_HEATED_BED |   #if HAS_HEATED_BED | ||||||
|     if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); |     if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); | ||||||
|   #else |  | ||||||
|     UNUSED(indb); |  | ||||||
|   #endif |   #endif | ||||||
|   #if HAS_FAN |   #if HAS_FAN | ||||||
|     set_fan_speed(( |     if (indh >= 0) | ||||||
|       #if FAN_COUNT > 1 |       set_fan_speed(active_extruder < (FAN_COUNT) ? active_extruder : 0, ui.material_preset[indh].fan_speed); | ||||||
|         active_extruder < FAN_COUNT ? active_extruder : |  | ||||||
|       #endif |  | ||||||
|       0), ui.material_preset[indh].fan_speed |  | ||||||
|     ); |  | ||||||
|   #endif |   #endif | ||||||
|   ui.return_to_status(); |   ui.return_to_status(); | ||||||
| } | } | ||||||
| @ -93,7 +86,9 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i | |||||||
| 
 | 
 | ||||||
|   #endif |   #endif | ||||||
| 
 | 
 | ||||||
|   void do_preheat_end_m() { _preheat_end(editable.int8, 0); } |   void do_preheat_end_m() { | ||||||
|  |     _preheat_end(editable.int8, 0); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   #if HAS_MULTI_HOTEND || HAS_HEATED_BED |   #if HAS_MULTI_HOTEND || HAS_HEATED_BED | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user