use boolean literals instead of implicit int conversion

This commit is contained in:
Stefan Kalscheuer
2023-06-24 14:04:11 +02:00
parent 0cedfaf9a6
commit 1822172d44
2 changed files with 5 additions and 5 deletions

View File

@@ -1074,7 +1074,7 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
char* starpos = NULL; char* starpos = NULL;
while (LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) { while (LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) {
serial3_char = LCD_SERIAL.read(); serial3_char = LCD_SERIAL.read();
if (serial3_char == '\n' || serial3_char == '\r' || (serial3_char == ':' && TFTcomment_mode == false) || if (serial3_char == '\n' || serial3_char == '\r' || (serial3_char == ':' && !TFTcomment_mode) ||
serial3_count >= (TFT_MAX_CMD_SIZE - 1)) { serial3_count >= (TFT_MAX_CMD_SIZE - 1)) {
if (!serial3_count) { // if empty line if (!serial3_count) { // if empty line
TFTcomment_mode = false; // for new command TFTcomment_mode = false; // for new command
@@ -1236,7 +1236,7 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
tempvalue = constrain(CodeValue(), 0, 260); tempvalue = constrain(CodeValue(), 0, 260);
if (getTargetTemp_celsius((extruder_t)E0) <= 260) { if (getTargetTemp_celsius((extruder_t)E0) <= 260) {
setTargetTemp_celsius(tempvalue, (extruder_t)E0); setTargetTemp_celsius(tempvalue, (extruder_t)E0);
}; // do not set Temp from TFT if it is set via gcode } // do not set Temp from TFT if it is set via gcode
} else if ((CodeSeen('C')) && (!isPrinting())) { } else if ((CodeSeen('C')) && (!isPrinting())) {
if ((getAxisPosition_mm(Z) < 10)) { if ((getAxisPosition_mm(Z) < 10)) {
injectCommands(F("G1 Z10")); // RASE Z AXIS injectCommands(F("G1 Z10")); // RASE Z AXIS
@@ -2062,7 +2062,7 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
"TFT Serial Debug: Starting SD Print... soft endstops disabled J04"); // J04 Starting Print "TFT Serial Debug: Starting SD Print... soft endstops disabled J04"); // J04 Starting Print
setSoftEndstopState(false); setSoftEndstopState(false);
live_Zoffset = 0.0; live_Zoffset = 0.0;
powerOFFflag = 0; powerOFFflag = false;
} }
#endif #endif
} }
@@ -2082,7 +2082,7 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;
mediaPauseState = AMPAUSESTATE_NOT_PAUSED; mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
setSoftEndstopState(true); setSoftEndstopState(true);
powerOFFflag = 1; powerOFFflag = true;
SENDLINE_DBG_PGM("J14", "TFT Serial Debug: SD Print Completed... soft endstops enabled J14"); SENDLINE_DBG_PGM("J14", "TFT Serial Debug: SD Print Completed... soft endstops enabled J14");
} }
// otherwise it was stopped by the printer so don't send print completed // otherwise it was stopped by the printer so don't send print completed

View File

@@ -222,7 +222,7 @@ class AnycubicTouchscreenClass {
uint16_t HeaterCheckCount = 0; uint16_t HeaterCheckCount = 0;
int currentFlowRate = 0; int currentFlowRate = 0;
bool PrintdoneAndPowerOFF = true; bool PrintdoneAndPowerOFF = true;
bool powerOFFflag = 0; bool powerOFFflag = false;
xy_uint8_t selectedmeshpoint; xy_uint8_t selectedmeshpoint;
float live_Zoffset; float live_Zoffset;