void lcd_preheat_abs_bedonly() { setTargetBed(absPreheatHPBTemp); fanSpeed = absPreheatFanSpeed; lcd_return_to_status(); setWatch(); // heater sanity check timer }
////i4 void lcd_cooldown() { setTargetHotend0(0); setTargetBed(0); fanSpeed = 0; lcd_return_to_status(); }
static void lcd_cooldown() { setTargetHotend0(0); setTargetHotend1(0); setTargetHotend2(0); setTargetBed(0); lcd_return_to_status(); }
void lcd_preheat_flex() { setTargetHotend0(flexPreheatHotendTemp); setTargetBed(flexPreheatHPBTemp); fanSpeed = 0; lcd_return_to_status(); setWatch(); // heater sanity check timer }
void lcd_preheat_pla2() { setTargetHotend2(plaPreheatHotendTemp); setTargetBed(plaPreheatHPBTemp); fanSpeed = plaPreheatFanSpeed; lcd_return_to_status(); setWatch(); // heater sanity check timer }
void lcd_preheat_abs() { setTargetHotend0(absPreheatHotendTemp); setTargetHotend1(absPreheatHotendTemp); setTargetHotend2(absPreheatHotendTemp); setTargetBed(absPreheatHPBTemp); fanSpeed = absPreheatFanSpeed; lcd_return_to_status(); }
void lcd_preheat_pla() { setTargetHotend0(plaPreheatHotendTemp); setTargetHotend1(plaPreheatHotendTemp); setTargetHotend2(plaPreheatHotendTemp); setTargetBed(plaPreheatHPBTemp); fanSpeed = plaPreheatFanSpeed; lcd_return_to_status(); }
void mct_ClickBed(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t which) { adjustValue = !adjustValue; if (adjustValue) { pos = intround(degTargetBed()); } else { setTargetBed(pos); } }
void lcd_preheat_abs() { for(int e = 0; e < EXTRUDERS; e++) { setTargetHotend(absPreheatHotendTemp, e); fanSpeed[e] = (unsigned char)absPreheatFanSpeed; } setTargetBed(absPreheatHPBTemp); lcd_return_to_status(); }
void lcd_preheat_nylon() { setTargetHotend0(nylonPreheatHotendTemp); setTargetHotend1(nylonPreheatHotendTemp); setTargetHotend2(nylonPreheatHotendTemp); setTargetBed(nylonPreheatHPBTemp); fanSpeed = nylonPreheatFanSpeed; lcd_return_to_status(); setWatch(); // heater sanity check timer }
void lcd_preheat_abs012() { setTargetHotend0(absPreheatHotendTemp); setTargetHotend1(absPreheatHotendTemp); setTargetHotend2(absPreheatHotendTemp); setTargetBed(absPreheatHPBTemp); fanSpeed = absPreheatFanSpeed; lcd_return_to_status(); setWatch(); // heater sanity check timer }
void lcd_preheat_laybrick() { setTargetHotend0(LAYBRICK_PREHEAT_HOTEND_TEMP); setTargetHotend1(LAYBRICK_PREHEAT_HOTEND_TEMP); setTargetHotend2(LAYBRICK_PREHEAT_HOTEND_TEMP); setTargetBed(LAYBRICK_PREHEAT_HPB_TEMP); fanSpeed = LAYBRICK_PREHEAT_FAN_SPEED; lcd_return_to_status(); setWatch(); // heater sanity check timer }
void lcd_preheat_abs() { setTargetHotend0(absPreheatHotendTemp); setTargetHotend1(absPreheatHotendTemp); setTargetHotend2(absPreheatHotendTemp); setTargetBed(absPreheatHPBTemp); #if FAN_PIN > -1 fanSpeed = absPreheatFanSpeed; analogWrite(FAN_PIN, fanSpeed); #endif lcd_return_to_status(); }
void checkHitEndstops() { if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { // #ifdef || endstop_z_probe_hit to save space if needed. SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); if (endstop_x_hit) { SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X"); } if (endstop_y_hit) { SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y"); } if (endstop_z_hit) { SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z"); } #ifdef Z_PROBE_ENDSTOP if (endstop_z_probe_hit) { SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP"); } #endif SERIAL_EOL; endstops_hit_on_purpose(); #if defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && defined(SDSUPPORT) if (abort_on_endstop_hit) { card.sdprinting = false; card.closefile(); quickStop(); setTargetHotend0(0); setTargetHotend1(0); setTargetHotend2(0); setTargetHotend3(0); setTargetBed(0); } #endif } }
void checkHitEndstops() { if( endstop_xmin_hit || endstop_xmax_hit || endstop_ymin_hit || endstop_ymax_hit || endstop_zmin_hit || endstop_zmax_hit) { SERIAL_ECHO_START; SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); if(endstop_xmin_hit || endstop_xmax_hit) { SERIAL_ECHOPAIR(" X:",(float)endstops_trigsteps[X_AXIS]/axis_steps_per_unit[X_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_TOUCH "X"); } if(endstop_ymin_hit || endstop_ymax_hit) { SERIAL_ECHOPAIR(" Y:",(float)endstops_trigsteps[Y_AXIS]/axis_steps_per_unit[Y_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_TOUCH "Y"); } if(endstop_zmin_hit || endstop_zmax_hit) { SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/axis_steps_per_unit[Z_AXIS]); LCD_MESSAGEPGM(MSG_ENDSTOPS_TOUCH "Z"); } SERIAL_ECHOLN(""); endstop_xmin_hit=false; endstop_xmax_hit=false; endstop_ymin_hit=false; endstop_ymax_hit=false; endstop_zmin_hit=false; endstop_zmax_hit=false; #if defined(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && defined(SDSUPPORT) if (abort_on_endstop_hit) { card.sdprinting = false; card.closefile(); quickStop(); setTargetHotend0(0); setTargetHotend1(0); setTargetHotend2(0); setTargetHotend3(0); setTargetBed(0); } #endif } }
void lcd_preheat_bed() { setTargetBed(BED_PREHEAT_TEMP); lcd_return_to_status(); setWatch(); //sanity check }
void process() { switch (buff_obj[0]) { case 'V': writeString((char *)"{VER:008}"); return; case 'S': if (buff_value[0]=='E') writeString((char *)"{SYS:echo}"); /* else if (buff_value[0]=='H') { uint8_t i,itemCount; itemCount=countFiles(false); //if (file_from_wifi!=0) { writeString((char *)"{WIFI:"); writeInt(file_from_wifi,3); put('/'); writeInt(itemCount,3); put('}'); } }*/ else if (buff_value[0]=='L') { uint8_t i; uint8_t itemCount; if ( card.isFileOpen() ) { writeString((char *)"{SYS:BUSY}"); return; } //card.initsd(); //card.getWorkDirName(); itemCount = countFiles(true); if (itemCount==0) { card.initsd(); card.setroot(); itemCount = countFiles(true); } for (i=0;i<itemCount;i++) { ListFile(i,itemCount); } if (itemCount==0) { if (card.cardOK) i=101; else i=102; writeString((char *)"{ERR:"); writeInt(i,3); put('}'); } else writeString((char *)"{SYS:OK}"); } else if (buff_value[0]=='I') { int16_t t; writeString((char *)"{T0:"); t=degHotend(0); if (t>999) t=999; writeInt(t,3); put('/'); t=degTargetHotend(0); writeInt(t,3); put('}'); writeString((char *)"{T1:"); t=degHotend(1); if (t>999) t=999; writeInt(t,3); put('/'); t=degTargetHotend(1); writeInt(t,3); put('}'); writeString((char *)"{TP:"); t=degBed(); if (t>999) t=999; writeInt(t,3); put('/'); t=degTargetBed(); writeInt(t,3); put('}'); } else if (buff_value[0]=='F') { /*if (buff_value[1]=='X') { eeprom::setEepromInt64(eeprom_offsets::FILAMENT_TRIP, eeprom::getEepromInt64(eeprom_offsets::FILAMENT_LIFETIME, 0)); eeprom::setEepromInt64(eeprom_offsets::FILAMENT_TRIP + sizeof(int64_t), eeprom::getEepromInt64(eeprom_offsets::FILAMENT_LIFETIME + sizeof(int64_t), 0)); }*/ writeString((char *)"{TU:"); uint16_t total_hours; uint8_t total_minutes; //eeprom::getBuildTime(&total_hours, &total_minutes); total_hours=0; total_minutes=0; writeInt(total_hours,5); put('.'); writeInt(total_minutes,2); put('/'); uint8_t build_hours; uint8_t build_minutes; //host::getPrintTime(build_hours, build_minutes); build_hours=0; build_minutes=0; writeInt(build_hours,3); put('.'); writeInt(build_minutes,2); put('/'); uint32_t filamentUsedA,filamentUsedB,filamentUsed; char str[11]; //filamentUsedA=stepperAxisStepsToMM(eeprom::getEepromInt64(eeprom_offsets::FILAMENT_LIFETIME, 0), A_AXIS); //filamentUsedB=stepperAxisStepsToMM(eeprom::getEepromInt64(eeprom_offsets::FILAMENT_LIFETIME + sizeof(int64_t),0), B_AXIS); //filamentUsed=filamentUsedA+filamentUsedB; filamentUsed=0; itoa(filamentUsed,str,10); writeString((char *)str); put('/'); //filamentUsedA -= stepperAxisStepsToMM(eeprom::getEepromInt64(eeprom_offsets::FILAMENT_TRIP, 0), A_AXIS); //filamentUsedB -= stepperAxisStepsToMM(eeprom::getEepromInt64(eeprom_offsets::FILAMENT_TRIP + sizeof(int64_t),0), B_AXIS); //filamentUsed=filamentUsedA+filamentUsedB; filamentUsed=0; itoa(filamentUsed,str,10); writeString((char *)str); put('}'); } else if (buff_value[0]=='R' && buff_value[1]=='E' && buff_value[2]=='S' && buff_value[3]=='E' && buff_value[4]=='T') { //Motherboard::getBoard().reset(true); } /* else if (buff_value[0]=='S') { writeString((char *)"{SYS:P"); uint8_t i = command::pauseState(); writeInt(i,3); put('/'); put('H'); i=host::getHostState(); writeInt(i,3); put('}'); } break; */ case 'C': if (buff_value[0]=='P') { uint16_t t; t=atoi((const char*)buff_value+1); if (t<0 || t>150) return; setTargetBed(t); } else if (buff_value[0]=='T') { int16_t t; t=atoi((const char*)buff_value+2); if (t<0 || t>280) return; if (buff_value[1] == '0') { setTargetHotend(t,0); } else { setTargetHotend(t,1); } } else if (buff_value[0]=='S') { int16_t t; uint8_t i; t=atoi((const char*)buff_value+1); if (t<1) t=1; else if (t>50) t=50; feedmultiply=t*10; } break; case 'P': uint8_t i; if (buff_value[0]=='H') { enquecommand_P(PSTR("G28")); } else if (buff_value[0]=='C') { //host::startOnboardBuild(utility::TOOLHEAD_CALIBRATE); } else if (buff_value[0]=='X') { extern bool cancel_heatup; writeString((char *)"{SYS:CANCELING}"); //card.pauseSDPrint(); //disable_heater(); card.sdprinting = false; card.closefile(); quickStop(); if(SD_FINISHED_STEPPERRELEASE) { enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND)); } autotempShutdown(); cancel_heatup = true; writeString((char *)"{SYS:STARTED}"); writeString((char *)"{U:RG1R180180120P0L1S0D0O1E1H0C0X1Y1Z1A2B2N3M0}"); } else if (buff_value[0]=='P') { writeString((char *)"{SYS:PAUSE}"); card.pauseSDPrint(); writeString((char *)"{SYS:PAUSED}"); } else if (buff_value[0]=='R') { writeString((char *)"{SYS:RESUME}"); card.startFileprint(); writeString((char *)"{SYS:RESUMED}"); } else if (buff_value[0]=='Z') { /*i=(buff_value[1]-'0')*100 + (buff_value[2]-'0')*10 + (buff_value[3]-'0'); float pauseAtZPos = i; command::pauseAtZPos(stepperAxisMMToSteps(pauseAtZPos, Z_AXIS));*/ } else { i=(buff_value[0]-'0')*100 + (buff_value[1]-'0')*10 + (buff_value[2]-'0'); card.getfilename(i); if (card.filenameIsDir) { writeString((char *)"{SYS:DIR}"); card.chdir(card.filename); } else { char cmd[30]; char* c; writeString((char *)"{PRINTFILE:"); if (card.longFilename[0]!=0) writeString(card.longFilename); else writeString(card.filename); put('}'); sprintf_P(cmd, PSTR("M23 %s"), card.filename); for(c = &cmd[4]; *c; c++) *c = tolower(*c); enquecommand(cmd); enquecommand_P(PSTR("M24")); } } break; case 'B': PrintingStatus(); break; /* case 'J': switch (buff_value[0]) { case 'S': BOARD_STATUS_SET(Motherboard::STATUS_MANUAL_MODE); jog_speed=atoi((const char*)buff_value+1); break; case 'E': steppers::enableAxes(0xff, false); BOARD_STATUS_CLEAR(Motherboard::STATUS_MANUAL_MODE); break; case 'X': case 'Y': case 'Z': case 'A': case 'B': steppers::abort(); uint8_t dummy; Point position = steppers::getStepperPosition(&dummy); int32_t t; t=atoi((const char*)buff_value+1); if (buff_value[0]<='B') position[buff_value[0]-'A'+3] += (t<<4); else position[buff_value[0]-'X'] += (t<<4); steppers::setTargetNew(position, jog_speed, 0, 0); break; } break; */ /* case 'H': if (buff_value[0]=='R') { extern uint32_t homePosition[PROFILES_HOME_POSITIONS_STORED]; writeString((char *)"{H:R"); eeprom_read_block(homePosition, (void *)eeprom_offsets::AXIS_HOME_POSITIONS_STEPS, PROFILES_HOME_POSITIONS_STORED * sizeof(uint32_t)); writeInt(homePosition[0],5); put('/'); writeInt(homePosition[1],5); put('/'); writeInt(homePosition[2],5); put('/'); writeInt((int32_t)(eeprom::getEeprom32(eeprom_offsets::TOOLHEAD_OFFSET_SETTINGS, 0)),5); put('/'); writeInt((int32_t)(eeprom::getEeprom32(eeprom_offsets::TOOLHEAD_OFFSET_SETTINGS + sizeof(int32_t), 0)),5); put('}'); } else if (buff_value[0]=='W') { extern uint32_t homePosition[PROFILES_HOME_POSITIONS_STORED]; int32_t offset[2],t; uint8_t axis; axis=buff_value[1]-'X'; if (axis>=0 && axis<=2) { homePosition[axis]=atoi((const char*)buff_value+2); cli(); eeprom_write_block((void *)&homePosition[axis], (void*)(eeprom_offsets::AXIS_HOME_POSITIONS_STEPS + sizeof(uint32_t) * axis) , sizeof(uint32_t)); sei(); } axis=buff_value[1]-'x'; if (axis>=0 && axis<=1) { t=atoi((const char*)buff_value+2); int32_t offset[2]; bool smallOffsets; offset[0] = (int32_t)(eeprom::getEeprom32(eeprom_offsets::TOOLHEAD_OFFSET_SETTINGS, 0)); offset[1] = (int32_t)(eeprom::getEeprom32(eeprom_offsets::TOOLHEAD_OFFSET_SETTINGS + sizeof(int32_t), 0)); smallOffsets = abs(offset[0]) < ((int32_t)stepperAxisStepsPerMM(0) << 2); int32_t delta = stepperAxisMMToSteps((float)(t - 7) * 0.1f, axis); if ( !smallOffsets ) delta = -delta; int32_t new_offset = offset[axis] + delta; eeprom_write_block((uint8_t *)&new_offset, (uint8_t *)eeprom_offsets::TOOLHEAD_OFFSET_SETTINGS + axis * sizeof(int32_t), sizeof(int32_t)); } } break; */ /* case 'U': if (buff_value[0]=='R') { int temp; writeString((char *)"{U:RG"); if (eeprom::getEeprom8(eeprom_offsets::OVERRIDE_GCODE_TEMP, 0) != 0) put('1'); else put('0'); put('R'); temp=eeprom::getEeprom16(eeprom_offsets::PREHEAT_SETTINGS + preheat_eeprom_offsets::PREHEAT_LEFT_OFFSET, DEFAULT_PREHEAT_TEMP); writeInt(temp,3); //put('/'); temp=eeprom::getEeprom16(eeprom_offsets::PREHEAT_SETTINGS + preheat_eeprom_offsets::PREHEAT_RIGHT_OFFSET, DEFAULT_PREHEAT_TEMP); writeInt(temp,3); //put('/'); temp=eeprom::getEeprom16(eeprom_offsets::PREHEAT_SETTINGS + preheat_eeprom_offsets::PREHEAT_PLATFORM_OFFSET, DEFAULT_PREHEAT_TEMP); writeInt(temp,3); put('P'); if (eeprom::hasHBP() != 0) put('1'); else put('0'); put('L'); if (eeprom::getEeprom8(eeprom_offsets::ACCELERATION_SETTINGS + acceleration_eeprom_offsets::ACCELERATION_ACTIVE, 0x01) != 0) put('1'); else put('0'); put('S'); if (eeprom::getEeprom8(eeprom_offsets::COOL_PLAT, 0) != 0) put('1'); else put('0'); put('D'); if (eeprom::getEeprom8(eeprom_offsets::DITTO_PRINT_ENABLED, 0) != 0) put('1'); else put('0'); put('O'); if (eeprom::getEeprom8(eeprom_offsets::TOOLHEAD_OFFSET_SYSTEM, DEFAULT_TOOLHEAD_OFFSET_SYSTEM) != 0) put('1'); else put('0'); put('E'); if (eeprom::getEeprom8(eeprom_offsets::EXTRUDER_HOLD, DEFAULT_EXTRUDER_HOLD) != 0) put('1'); else put('0'); put('H'); if (eeprom::getEeprom8(eeprom_offsets::HEAT_DURING_PAUSE, DEFAULT_HEAT_DURING_PAUSE) != 0) put('1'); else put('0'); put('C'); if (eeprom::getEeprom8(eeprom_offsets::SD_USE_CRC, DEFAULT_SD_USE_CRC) != 0) put('1'); else put('0'); put('X'); put ('0' + eeprom::getEeprom8(eeprom_offsets::STEPPER_X_CURRENT, 0)); put('Y'); put ('0' + eeprom::getEeprom8(eeprom_offsets::STEPPER_Y_CURRENT, 0)); put('Z'); put ('0' + eeprom::getEeprom8(eeprom_offsets::STEPPER_Z_CURRENT, 0)); put('A'); put ('0' + eeprom::getEeprom8(eeprom_offsets::STEPPER_A_CURRENT, 0)); put('B'); put ('0' + eeprom::getEeprom8(eeprom_offsets::STEPPER_B_CURRENT, 0)); put('N'); put ('0' + eeprom::getEeprom8(eeprom_offsets::LANGUAGE, 0)); put('M'); put ('0' + eeprom::getEeprom8(eeprom_offsets::WIFI_SD, 0)); put('}'); } else if (buff_value[0]=='W') { uint8_t *c; uint8_t cmd=0; c=buff_value; while (*++c!=0) { if (*c<='9' && *c>='0') { uint8_t value; value = *c - '0'; switch (cmd) { case 'G': eeprom_write_byte((uint8_t *)eeprom_offsets::OVERRIDE_GCODE_TEMP,value); break; case 'P': eeprom_write_byte((uint8_t*)eeprom_offsets::HBP_PRESENT, value); break; case 'L': eeprom_write_byte((uint8_t*)eeprom_offsets::ACCELERATION_SETTINGS + acceleration_eeprom_offsets::ACCELERATION_ACTIVE, value); break; case 'S': eeprom_write_byte((uint8_t*)eeprom_offsets::COOL_PLAT, value); break; case 'D': eeprom_write_byte((uint8_t*)eeprom_offsets::DITTO_PRINT_ENABLED, value); break; case 'O': eeprom_write_byte((uint8_t*)eeprom_offsets::TOOLHEAD_OFFSET_SYSTEM, value); break; case 'E': eeprom_write_byte((uint8_t*)eeprom_offsets::EXTRUDER_HOLD, value); break; case 'H': eeprom_write_byte((uint8_t*)eeprom_offsets::HEAT_DURING_PAUSE, value); break; case 'C': eeprom_write_byte((uint8_t*)eeprom_offsets::SD_USE_CRC, value); break; case 'T': eeprom_write_byte((uint8_t*)eeprom_offsets::PSTOP_ENABLE, value); break; case 'X': eeprom_write_byte((uint8_t*)eeprom_offsets::STEPPER_X_CURRENT, value); break; case 'Y': eeprom_write_byte((uint8_t*)eeprom_offsets::STEPPER_Y_CURRENT, value); break; case 'Z': eeprom_write_byte((uint8_t*)eeprom_offsets::STEPPER_Z_CURRENT, value); break; case 'A': eeprom_write_byte((uint8_t*)eeprom_offsets::STEPPER_A_CURRENT, value); break; case 'B': eeprom_write_byte((uint8_t*)eeprom_offsets::STEPPER_B_CURRENT, value); break; case 'N': eeprom_write_byte((uint8_t*)eeprom_offsets::LANGUAGE, value); break; case 'M': eeprom_write_byte((uint8_t*)eeprom_offsets::WIFI_SD, value); break; default: break; } } else if (*c<='Z' && *c>='A') cmd = *c; } } else if (buff_value[0] == 'U' && buff_value[1] == 'P' && buff_value[2] == 'D' && buff_value[3] == 'A' && buff_value[4] == 'T' && buff_value[5] == 'E') { char r; cli(); wdt_disable(); while (1) { if (UCSR0A & (1<<RXC0)) { r = UDR0; UDR3 = r; } if (UCSR3A & (1<<RXC3)) { r = UDR3; UDR0 = r; } } } else { if (buff_value[0]=='E' && buff_value[1]=='R' && buff_value[2]=='A' && buff_value[3]=='S' && buff_value[4]=='E') { eeprom::factoryResetEEPROM(); Motherboard::getBoard().reset(true); } else if (buff_value[0]=='F' && buff_value[1]=='U' && buff_value[2]=='L' && buff_value[3]=='L' && buff_value[4]=='E' && buff_value[5]=='R' && buff_value[6]=='A' && buff_value[7]=='S' && buff_value[8]=='E') { eeprom::erase(); host::stopBuildNow(); } } break; */ default: break; } }