Add PINDA_TEMP_COMP variable to enable SuperPINDA toggle menu/function

This commit is contained in:
3d-gussner 2020-12-08 17:50:04 +01:00
parent a97587f373
commit 4b510fef0a
9 changed files with 17 additions and 3 deletions

View File

@ -2330,13 +2330,17 @@ float unscalePID_d(float d)
bool has_temperature_compensation()
{
#ifdef SUPERPINDA_SUPPORT
#ifdef PINDA_TEMP_COMP
uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION);
if (pinda_temp_compensation == EEPROM_EMPTY_VALUE) //Unkown PINDA temp compenstation, so check it.
{
#endif //PINDA_TEMP_COMP
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
#ifdef PINDA_TEMP_COMP
}
else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No]
else return false; //Overwritten via LCD menu SuperPINDA [YES]
#endif //PINDA_TEMP_COMP
#else
return true;
#endif

View File

@ -5753,14 +5753,14 @@ void lcd_hw_setup_menu(void) // can not be "static"
MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18
}
#ifdef SUPERPINDA_SUPPORT
#ifdef PINDA_TEMP_COMP
//! The SuperPINDA is detected when the PINDA temp is below its defined limit.
//! This works well on the EINSY board but not on the miniRAMBo board as
//! as a disconnected SuperPINDA will show higher temps compared to an EINSY board.
//!
//! This menu allows the user to en-/disable the SuperPINDA manualy
MENU_ITEM_TOGGLE_P(_N("SuperPINDA"), eeprom_read_byte((unsigned char *)EEPROM_PINDA_TEMP_COMPENSATION) ? _T(MSG_YES) : _T(MSG_NO), lcd_pinda_temp_compensation_toggle);
#endif //SUPERPINDA_SUPPORT
#endif //PINDA_TEMP_COMP
MENU_END();
}
@ -9245,6 +9245,7 @@ void lcd_experimental_menu()
MENU_END();
}
#ifdef PINDA_TEMP_COMP
void lcd_pinda_temp_compensation_toggle()
{
uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION);
@ -9253,6 +9254,7 @@ void lcd_pinda_temp_compensation_toggle()
else
pinda_temp_compensation = !pinda_temp_compensation;
eeprom_update_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation);
SERIAL_ECHOLNPGM("LCD U SuperPINDA:");
SERIAL_ECHOLNPGM("SuperPINDA:");
SERIAL_ECHOLN(pinda_temp_compensation);
}
#endif //PINDA_TEMP_COMP

View File

@ -262,6 +262,8 @@ void lcd_wizard(WizState state);
extern void lcd_experimental_toggle();
extern void lcd_experimental_menu();
#ifdef PINDA_TEMP_COMP
extern void lcd_pinda_temp_compensation_toggle();
#endif //PINDA_TEMP_COMP
#endif //ULTRALCD_H

View File

@ -177,6 +177,7 @@
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -178,6 +178,7 @@
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -177,6 +177,7 @@
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -178,6 +178,7 @@
#endif
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 30 //The miniRAMBo thermistor readings below 30°C aren't very accurate
#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -297,6 +297,7 @@
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 10
#define AMBIENT_MINTEMP -30
//#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)

View File

@ -299,6 +299,7 @@
#define SUPERPINDA_SUPPORT
#define PINDA_MINTEMP 10
#define AMBIENT_MINTEMP -30
//#define PINDA_TEMP_COMP //Used to enable SuperPINDA toggle menu/function
// Maxtemps
#if defined(E3D_PT100_EXTRUDER_WITH_AMP) || defined(E3D_PT100_EXTRUDER_NO_AMP)