static void lcd_menu_change_material_preheat()
{
#ifdef USE_CHANGE_TEMPERATURE
    setTargetHotend(material[active_extruder].change_temperature, active_extruder);
#else
    setTargetHotend(material[active_extruder].temperature, active_extruder);
#endif
    int16_t temp = degHotend(active_extruder) - 20;
    int16_t target = degTargetHotend(active_extruder) - 20;
    if (temp < 0) temp = 0;
    if (temp > target - 5 && temp < target + 5)
    {
        if ((signed long)(millis() - preheat_end_time) > 0)
        {
            set_extrude_min_temp(0);
            
            plan_set_e_position(0);
            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], 20.0 / volume_to_filament_length[active_extruder], retract_feedrate/60.0, active_extruder);

            float old_max_feedrate_e = max_feedrate[E_AXIS];
            float old_retract_acceleration = retract_acceleration;
            max_feedrate[E_AXIS] = FILAMENT_REVERSAL_SPEED;
            retract_acceleration = FILAMENT_LONG_MOVE_ACCELERATION;

            plan_set_e_position(0);
            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], -1.0 / volume_to_filament_length[active_extruder], FILAMENT_REVERSAL_SPEED, active_extruder);
            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], -FILAMENT_REVERSAL_LENGTH / volume_to_filament_length[active_extruder], FILAMENT_REVERSAL_SPEED, active_extruder);

            max_feedrate[E_AXIS] = old_max_feedrate_e;
            retract_acceleration = old_retract_acceleration;

            currentMenu = lcd_menu_change_material_remove;
            temp = target;
        }
    }
    else
    {
#ifdef USE_CHANGE_TEMPERATURE
        preheat_end_time = millis() + (unsigned long)material[active_extruder].change_preheat_wait_time * 1000L;
#else
        preheat_end_time = millis();
#endif
    }

    uint8_t progress = uint8_t(temp * 125 / target);
    if (progress < minProgress)
        progress = minProgress;
    else
        minProgress = progress;

    lcd_info_screen(post_change_material_menu, cancelMaterialInsert);
    lcd_lib_draw_stringP(3, 10, PSTR("Heating printhead"));
    lcd_lib_draw_stringP(3, 20, PSTR("for material removal"));
    
    lcd_progressbar(progress);

    lcd_lib_update_screen();
}
static void lcd_menu_insert_material_preheat()
{
    setTargetHotend(material[active_extruder].temperature, active_extruder);
    int16_t temp = degHotend(active_extruder) - 20;
    int16_t target = degTargetHotend(active_extruder) - 20 - 10;
    if (temp < 0) temp = 0;
    if (temp > target && !is_command_queued())
    {
        set_extrude_min_temp(0);
        for(uint8_t e=0; e<EXTRUDERS; e++)
            volume_to_filament_length[e] = 1.0;//Set the extrusion to 1mm per given value, so we can move the filament a set distance.

        currentMenu = lcd_menu_change_material_insert_wait_user;
        temp = target;
    }

    uint8_t progress = uint8_t(temp * 125 / target);
    if (progress < minProgress)
        progress = minProgress;
    else
        minProgress = progress;
    
    lcd_info_screen(lcd_menu_material_main, cancelMaterialInsert);
    lcd_lib_draw_stringP(3, 10, PSTR("Heating printhead for"));
    lcd_lib_draw_stringP(3, 20, PSTR("material insertion"));

    lcd_progressbar(progress);
    
    lcd_lib_update_screen();
}
static void lcd_menu_first_run_material_load_heatup()
{
    setTargetHotend(230, 0);
    int16_t temp = degHotend(0) - 20;
    int16_t target = degTargetHotend(0) - 10 - 20;
    if (temp < 0) temp = 0;
    if (temp > target)
    {
        for(uint8_t e=0; e<EXTRUDERS; e++)
            volume_to_filament_length[e] = 1.0;//Set the extrusion to 1mm per given value, so we can move the filament a set distance.
        
        currentMenu = lcd_menu_first_run_material_load_insert;
        temp = target;
    }

    uint8_t progress = uint8_t(temp * 125 / target);
    if (progress < minProgress)
        progress = minProgress;
    else
        minProgress = progress;
    
    lcd_basic_screen();
    DRAW_PROGRESS_NR(12);
    lcd_lib_draw_string_centerP(10, PSTR("Please wait,"));
    lcd_lib_draw_string_centerP(20, PSTR("printhead heating for"));
    lcd_lib_draw_string_centerP(30, PSTR("material loading"));

    lcd_progressbar(progress);
    
    lcd_lib_update_screen();
}
static void lcd_menu_change_material_preheat()
{
    run_history = true;
    setTargetHotend(material[active_extruder].temperature, active_extruder);
    int16_t temp = degHotend(active_extruder) - 20;
    int16_t target = degTargetHotend(active_extruder) - 20 - 10;
    if (temp < 0) temp = 0;
    if (temp > target && !is_command_queued())
        {
            set_extrude_min_temp(0);
            for(uint8_t e=0; e<EXTRUDERS; e++)
                volume_to_filament_length[e] = 1.0;//Set the extrusion to 1mm per given value, so we can move the filament a set distance.

            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], 20.0, retract_feedrate/60.0, active_extruder);

            float old_max_feedrate_e = max_feedrate[E_AXIS];
            float old_retract_acceleration = retract_acceleration;
            max_feedrate[E_AXIS] = FILAMENT_REVERSAL_SPEED;
            retract_acceleration = FILAMENT_LONG_MOVE_ACCELERATION;

            current_position[E_AXIS] = 0;
            plan_set_e_position(current_position[E_AXIS]);
            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], -1.0, FILAMENT_REVERSAL_SPEED, active_extruder);
            for(uint8_t n=0; n<6; n++)
                plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], (n+1)*-FILAMENT_REVERSAL_LENGTH/6, FILAMENT_REVERSAL_SPEED, active_extruder);

            max_feedrate[E_AXIS] = old_max_feedrate_e;
            retract_acceleration = old_retract_acceleration;

            currentMenu = lcd_menu_change_material_remove;
            temp = target;
        }

    uint8_t progress = uint8_t(temp * 125 / target);
    if (progress < minProgress)
        progress = minProgress;
    else
        minProgress = progress;

    lcd_info_screen(lcd_menu_material_main, cancelMaterialInsert);
    lcd_lib_draw_stringP(3, 0, PSTR("Heating printhead"));
    lcd_lib_draw_stringP(3, 10, PSTR("for material removal"));

    char buffer[20];
    memset (buffer,0,sizeof(buffer));


    char* c;

    c = int_to_string(temp, buffer/*, PSTR( DEGREE_C_SYMBOL )*/);
    *c++ = TEMPERATURE_SEPARATOR;
    c = int_to_string(target, c, PSTR( DEGREE_C_SYMBOL ));
    lcd_lib_draw_string_center(20, buffer);

    lcd_progressbar(progress);
    LED_HEAT();
    lcd_lib_update_screen();
}
static void lcd_menu_change_material_remove_wait_user()
{
    LED_GLOW();
    setTargetHotend(material[active_extruder].temperature, active_extruder);

    lcd_question_screen(NULL, lcd_menu_change_material_remove_wait_user_ready, PSTR("READY"), post_change_material_menu, cancelMaterialInsert, PSTR("CANCEL"));
    lcd_lib_draw_string_centerP(20, PSTR("Remove material"));
    lcd_lib_update_screen();
}
void mct_ClickNozzle(uint8_t line, volatile long &pos, bool &adjustValue, uint8_t extruder)
{
    adjustValue = !adjustValue;
    if (adjustValue) {
	pos = intround(degTargetHotend(extruder));
    } else {
	setTargetHotend(pos, extruder);
    }
}
Example #7
0
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 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;
    }
}