Another fix from PR https://github.com/prusa3d/Prusa-Firmware/pull/138 and discussed in Issue https://github.com/prusa3d/Prusa-Firmware/issues/807
Ardunio IDE 1.6.8 and 1.8.5 result with Compiler warnings set to "More" or "All"
´´´
sketch\mesh_bed_calibration.cpp: In function 'sample_mesh_and_store_reference':
sketch\mesh_bed_calibration.cpp:2852:53: warning: 'zmax' may be used uninitialized in this function [-Wmaybe-uninitialized]
zmax = min(zmax, mbl.z_values[j][i]);
^
sketch\mesh_bed_calibration.cpp:2848:15: note: 'zmax' was declared here
float zmax = zmax;
^
´´´
Again another fix from https://github.com/prusa3d/Prusa-Firmware/pull/138 made by @Thess for the MK2 branch which i think is quite important.
Ardunio IDE 1.8.5 result with Compiler warnings set to "More" or "All"
```
sketch\Marlin_main.cpp:3265:44: warning: the address of 'retracted' will always evaluate as 'true' [-Waddress]
if((echange<-MIN_RETRACT && !retracted) || (echange>MIN_RETRACT && retracted)) { //move appears to be an attempt to retract or recover
^
sketch\Marlin_main.cpp:3265:82: warning: the address of 'retracted' will always evaluate as 'true' [-Waddress]
if((echange<-MIN_RETRACT && !retracted) || (echange>MIN_RETRACT && retracted)) { //move appears to be an attempt to retract or recover
^
sketch\Marlin_main.cpp:3268:28: warning: the address of 'retracted' will always evaluate as 'true' [-Waddress]
retract(!retracted);
^
sketch\Marlin_main.cpp:3870:15: warning: statement has no effect [-Wunused-value]
```
I don't know if that helps making small pull requests as they are easier to review or it would make sense to combine few more.
Prusa should really review this pull [request](https://github.com/prusa3d/Prusa-Firmware/pull/138) again for the MK3 branch, as it was one that made warnings disapear in the MK2 branch and made finding new flaws in the code much much easier.
The M860 - wait for PINDA temperature - gcode has been improved. Until now it could only wait until the PINDA has been warmed up to a set temperature. Now it also can wait until the PINDA has cooled down to a set temperature. The calling syntax has not been changed at all. The logic now looks if the bed or hotend have a target temperature different from 0. If so, the code waits until PINDA has warmed up. Otherwise it waits until PINDA has cooled down.
Applications:
- Possibility to start a Print at exactly the right PINDA temperature. (Do not start the heater until PINDA is cooled down)
- Much easier manual temperature calibration (automating the wait for cool down in between calibration runs)
- Possibility for temp calibration verification on one heat bed by printing multiple objects with different PINDA temperatures one after the other