conditional compilation improved: fsensor_autoload_check_stop() and fsensor_autoload_check_start(); M600 "filament not responding" error on printers with ir sensor fixed

This commit is contained in:
PavelSindler 2019-01-24 16:00:52 +01:00
parent ad65024147
commit da2c963893
3 changed files with 15 additions and 6 deletions

View file

@ -7471,7 +7471,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
{
if (fsensor_check_autoload())
{
#ifdef PAT9125
fsensor_autoload_check_stop();
#endif //PAT9125
if (degHotend0() > EXTRUDE_MINTEMP)
{
if ((eSoundMode == e_SOUND_MODE_LOUD) || (eSoundMode == e_SOUND_MODE_ONCE))
@ -7491,7 +7493,9 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
}
else
{
#ifdef PAT9125
fsensor_autoload_check_stop();
#endif //PAT9125
fsensor_update();
}
}
@ -9183,9 +9187,9 @@ void M600_load_filament() {
//load_filament_time = millis();
KEEPALIVE_STATE(PAUSED_FOR_USER);
#ifdef FILAMENT_SENSOR
#ifdef PAT9125
fsensor_autoload_check_start();
#endif //FILAMENT_SENSOR
#endif //PAT9125
while(!lcd_clicked())
{
manage_heater();
@ -9201,9 +9205,9 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
}
#endif //FILAMENT_SENSOR
}
#ifdef FILAMENT_SENSOR
#ifdef PAT9125
fsensor_autoload_check_stop();
#endif //FILAMENT_SENSOR
#endif //PAT9125
KEEPALIVE_STATE(IN_HANDLER);
#ifdef FSENSOR_QUALITY

View file

@ -197,7 +197,9 @@ void fsensor_disable(void)
void fsensor_autoload_set(bool State)
{
#ifdef PAT9125
if (!State) fsensor_autoload_check_stop();
#endif //PAT9125
fsensor_autoload_enabled = State;
eeprom_update_byte((unsigned char *)EEPROM_FSENS_AUTOLOAD_ENABLED, fsensor_autoload_enabled);
}
@ -210,6 +212,7 @@ void pciSetup(byte pin)
PCICR |= bit (digitalPinToPCICRbit(pin)); // enable interrupt for the group
}
#ifdef PAT9125
void fsensor_autoload_check_start(void)
{
// puts_P(_N("fsensor_autoload_check_start\n"));
@ -236,7 +239,7 @@ void fsensor_autoload_check_start(void)
void fsensor_autoload_check_stop(void)
{
#ifdef PAT9125
// puts_P(_N("fsensor_autoload_check_stop\n"));
if (!fsensor_enabled) return;
// puts_P(_N("fsensor_autoload_check_stop 1\n"));
@ -248,8 +251,8 @@ void fsensor_autoload_check_stop(void)
fsensor_watch_autoload = false;
fsensor_watch_runout = true;
fsensor_err_cnt = 0;
#endif //PAT9125
}
#endif //PAT9125
bool fsensor_check_autoload(void)
{

View file

@ -41,8 +41,10 @@ extern void fsensor_setup_interrupt(void);
//! @name autoload support
//! @{
#ifdef PAT9125
extern void fsensor_autoload_check_start(void);
extern void fsensor_autoload_check_stop(void);
#endif //PAT9125
extern bool fsensor_check_autoload(void);
//! @}