Simplify parsing M862

This gets rid of float conversion.
We just need to check the 6th character when M862 is detected. This
character gives us the digit after the dot.

Change in memory:
Flash: -20 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2022-12-03 11:50:12 +00:00 committed by DRracer
parent b9fecab239
commit 478627b6bc
1 changed files with 5 additions and 5 deletions

View File

@ -8021,10 +8021,9 @@ Sigma_Exit:
*/
case 862: // M862: print checking
float nDummy;
uint8_t nCommand;
nCommand=(uint8_t)(modff(code_value(),&nDummy)*10.0+0.5);
switch((ClPrintChecking)nCommand)
{
ClPrintChecking nCommand = static_cast<ClPrintChecking>(strtol(strchr_pointer+5, NULL, 10));
switch(nCommand)
{
case ClPrintChecking::_Nozzle: // ~ .1
uint16_t nDiameter;
@ -8074,7 +8073,8 @@ Sigma_Exit:
SERIAL_PROTOCOLLN(GCODE_LEVEL);
break;
}
break;
break;
}
#ifdef LIN_ADVANCE
/*!