Chiron TFT leveling refactoring.

This commit is contained in:
Knutwurst
2021-04-27 22:35:35 +02:00
parent cb4eafedb6
commit d73d9c8034
2 changed files with 60 additions and 71 deletions

View File

@@ -88,7 +88,7 @@
*
*/
#if ENABLED(KNUTWURST_CHIRON)
//#define KNUTWURST_TFT_LEVELING
#define KNUTWURST_TFT_LEVELING
#endif

View File

@@ -1919,7 +1919,6 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
#if ENABLED(KNUTWURST_TFT_LEVELING)
case 29: // A29 bed grid read
{
#ifdef AUTO_BED_LEVELING_BILINEAR
if(CodeSeen('X')) x = CodeValue();
if(CodeSeen('Y')) y = CodeValue();
float Zvalue = z_values[x][y];
@@ -1953,11 +1952,9 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
HARDWARE_SERIAL_PROTOCOLPGM("A29V ");
HARDWARE_SERIAL_PROTOCOL(ftostr32(Zvalue));
HARDWARE_SERIAL_ENTER();
#endif
}
break;
case 30: // A30 auto leveling
#ifdef AUTO_BED_LEVELING_BILINEAR
if( (planner.movesplanned()) || (card.isPrinting()) ) {
HARDWARE_SERIAL_PROTOCOLPGM("J24"); // forbid auto leveling
HARDWARE_SERIAL_ENTER();
@@ -1968,13 +1965,8 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
if(CodeSeen('S') ) {
queue.enqueue_now_P(PSTR("G28\nG29"));
}
#else
HARDWARE_SERIAL_PROTOCOLPGM("J24"); // forbid auto leveling
HARDWARE_SERIAL_ENTER();
#endif
break;
case 31: // A31 zoffset set get or save
#ifdef AUTO_BED_LEVELING_BILINEAR
if(CodeSeen('S'))
{
float value = constrain(CodeValue(),-1.0,1.0);
@@ -2005,7 +1997,6 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
refresh_bed_level();
}
HARDWARE_SERIAL_ENTER();
#endif
break;
case 32: //a32 clean leveling beep flag
break;
@@ -2019,7 +2010,6 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
break;
case 34: //a34 bed grid write
{
#ifdef AUTO_BED_LEVELING_BILINEAR
if(CodeSeen('X')) x = constrain(CodeValue(),0,GRID_MAX_POINTS_X);
if(CodeSeen('Y')) y = constrain(CodeValue(),0,GRID_MAX_POINTS_Y);
if(CodeSeen('V'))
@@ -2043,7 +2033,6 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
set_bed_leveling_enabled(true);
refresh_bed_level();
}
#endif
}
break;
case 35: //RESET AUTOBED DATE //M1000