Add SuperPINDA support for MK2.5/S

- Changed DETECT_SUPERPINDA to SUPERPINDA_SUPPORT as on miniRAMo the thermistor readings below 30°C
  aren't accurate egnough to determine if SUPERPINDA is connected or not
- Add LCD toggle menu Settings -> HW Setup -> SuperPINDA [Yes/No] to overwrite SuperPINDA detection
  - If EEPROM_PINDA_TEMP_COMPENSTATION is empty = 0xff then detect SuperPINDA by checking thermistor
  - If EEPROM_PINDA_TEMP_COMPENSTAION is 0 then forec enable for temperature compensation menues and functions
  - If EEPROM_PINDA_TEMP_COMPENSATION is 1 then force disable for temperature compensation menues and functions
This commit is contained in:
3d-gussner 2020-12-07 15:32:19 +01:00
parent a8ed6cefcf
commit 62c36f718b
11 changed files with 52 additions and 10 deletions

View file

@ -2325,11 +2325,21 @@ float unscalePID_d(float d)
//!
//! @retval true firmware should do temperature compensation and allow calibration
//! @retval false PINDA thermistor is not detected, disable temperature compensation and calibration
//! @retval true/false when overwritten in LCD menu Settings->HW Setup->SuperPINDA
//!
bool has_temperature_compensation()
{
#ifdef DETECT_SUPERPINDA
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
#ifdef SUPERPINDA_SUPPORT
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.
{
//SERIAL_ECHOLNPGM("Current PINDATEMP:");
//SERIAL_ECHO(current_temperature_pinda);
//SERIAL_ECHOLN(PINDA_MINTEMP);
return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false;
}
else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No]
else return false; //Overwritten via LCD menu SuperPINDA [YES]
#else
return true;
#endif