Skip to content

Commit 857900f

Browse files
Define new Setting "HeatBedOnLoad" [Yes/No]
1 parent 30ad54d commit 857900f

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

Firmware/eeprom.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ void eeprom_init()
9797
#ifdef PINDA_TEMP_COMP
9898
if (eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION) == 0xff) eeprom_update_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION, 0);
9999
#endif //PINDA_TEMP_COMP
100+
101+
if (eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT) == EEPROM_EMPTY_VALUE) eeprom_update_byte((uint8_t *)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1);
100102
}
101103

102104
//! @brief Get default sheet name for index

Firmware/eeprom.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP
322322
| 0x0D11 3345 | float | EEPROM_UVLO_ACCELL | ??? | ff ff ff ffh | Power panic saved normal acceleration | ??? | D3 Ax0d11 C4
323323
| 0x0D0D 3341 | float | EEPROM_UVLO_RETRACT_ACCELL | ??? | ff ff ff ffh | Power panic saved retract acceleration | ??? | D3 Ax0d0d C4
324324
| 0x0D09 3337 | float | EEPROM_UVLO_TRAVEL_ACCELL | ??? | ff ff ff ffh | Power panic saved travel acceleration | ??? | D3 Ax0d09 C4
325+
| 0x0D08 3336 | uint8 | EEPROM_HEAT_BED_ON_LOAD_FILAMENT | ffh 255 | ffh 255 | Heat bed on load filament unknown state | LCD menu | D3 Ax0d08 C1
326+
| ^ | ^ | ^ | 00h 0 | ^ | Do not heat bed on load filament | ^ | ^
327+
| ^ | ^ | ^ | 01h 1 | ^ | Heat bed on load filament | ^ | ^
325328
326329
| Address begin | Bit/Type | Name | Valid values | Default/FactoryReset | Description | Gcode/Function| Debug code
327330
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--:
@@ -532,8 +535,10 @@ static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE);
532535
#define EEPROM_UVLO_RETRACT_ACCELL (EEPROM_UVLO_ACCELL-4) // float
533536
#define EEPROM_UVLO_TRAVEL_ACCELL (EEPROM_UVLO_RETRACT_ACCELL-4) // float
534537

538+
#define EEPROM_HEAT_BED_ON_LOAD_FILAMENT (EEPROM_UVLO_TRAVEL_ACCELL-1) //uint8
539+
535540
//This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items.
536-
#define EEPROM_LAST_ITEM EEPROM_UVLO_TRAVEL_ACCELL
541+
#define EEPROM_LAST_ITEM EEPROM_HEAT_BED_ON_LOAD_FILAMENT
537542
// !!!!!
538543
// !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!!
539544
// !!!!!

Firmware/ultralcd.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -2225,6 +2225,10 @@ bool bFilamentAction=false;
22252225
static bool bFilamentWaitingFlag=false;
22262226

22272227
bool shouldPreheatOnlyNozzle() {
2228+
uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT);
2229+
if (eeprom_setting != 0)
2230+
return false;
2231+
22282232
switch(eFilamentAction) {
22292233
case FilamentAction::Load:
22302234
case FilamentAction::AutoLoad:
@@ -5755,6 +5759,9 @@ static void lcd_settings_menu()
57555759
}
57565760
#endif //LCD_BL_PIN
57575761

5762+
//! Enables/disables the bed heating while heating the nozzle for loading/unloading filament
5763+
MENU_ITEM_TOGGLE_P(_N("HeatBedOnLoad"), eeprom_read_byte((uint8_t *)EEPROM_HEAT_BED_ON_LOAD_FILAMENT) ? _T(MSG_YES) : _T(MSG_NO), lcd_heat_bed_on_load_toggle);
5764+
57585765
if (farm_mode)
57595766
{
57605767
MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode);
@@ -8979,3 +8986,13 @@ void lcd_pinda_temp_compensation_toggle()
89798986
SERIAL_ECHOLN(pinda_temp_compensation);
89808987
}
89818988
#endif //PINDA_TEMP_COMP
8989+
8990+
void lcd_heat_bed_on_load_toggle()
8991+
{
8992+
uint8_t value = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT);
8993+
if (value > 1)
8994+
value = 1;
8995+
else
8996+
value = !value;
8997+
eeprom_update_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value);
8998+
}

Firmware/ultralcd.h

+2
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,6 @@ extern void lcd_experimental_menu();
265265
extern void lcd_pinda_temp_compensation_toggle();
266266
#endif //PINDA_TEMP_COMP
267267

268+
extern void lcd_heat_bed_on_load_toggle();
269+
268270
#endif //ULTRALCD_H

0 commit comments

Comments
 (0)