New filament sensor
This commit is contained in:
parent
41b78187ca
commit
6157c3ab32
|
|
@ -1813,6 +1813,15 @@ void loop()
|
||||||
isPrintPaused ? manage_inactivity(true) : manage_inactivity(false);
|
isPrintPaused ? manage_inactivity(true) : manage_inactivity(false);
|
||||||
checkHitEndstops();
|
checkHitEndstops();
|
||||||
lcd_update(0);
|
lcd_update(0);
|
||||||
|
#ifdef NEW_FILAMENT_SENSOR
|
||||||
|
if (mcode_in_progress != 600 && !mmu_enabled) //M600 not in progress
|
||||||
|
{
|
||||||
|
if (IS_SD_PRINTING)
|
||||||
|
{
|
||||||
|
fsensor_update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif //NEW_FILAMENT_SENSOR
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
tmc2130_check_overtemp();
|
tmc2130_check_overtemp();
|
||||||
if (tmc2130_sg_crash)
|
if (tmc2130_sg_crash)
|
||||||
|
|
|
||||||
|
|
@ -477,6 +477,18 @@ void fsensor_st_block_chunk(block_t* bl, int cnt)
|
||||||
//! If there is still no plausible signal from filament sensor plans M600 (Filament change).
|
//! If there is still no plausible signal from filament sensor plans M600 (Filament change).
|
||||||
void fsensor_update(void)
|
void fsensor_update(void)
|
||||||
{
|
{
|
||||||
|
#ifdef NEW_FILAMENT_SENSOR
|
||||||
|
if (digitalRead(A8) == 1)
|
||||||
|
{
|
||||||
|
fsensor_stop_and_save_print();
|
||||||
|
printf_P(PSTR("fsensor_update - M600\n"));
|
||||||
|
eeprom_update_byte((uint8_t*)EEPROM_FERROR_COUNT, eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT) + 1);
|
||||||
|
eeprom_update_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) + 1);
|
||||||
|
enquecommand_front_P(PSTR("FSENSOR_RECOVER"));
|
||||||
|
enquecommand_front_P((PSTR("M600")));
|
||||||
|
fsensor_watch_runout = false;
|
||||||
|
}
|
||||||
|
#else //NEW_FILAMENT_SENSOR
|
||||||
if (fsensor_enabled && fsensor_watch_runout && (fsensor_err_cnt > FSENSOR_ERR_MAX))
|
if (fsensor_enabled && fsensor_watch_runout && (fsensor_err_cnt > FSENSOR_ERR_MAX))
|
||||||
{
|
{
|
||||||
bool autoload_enabled_tmp = fsensor_autoload_enabled;
|
bool autoload_enabled_tmp = fsensor_autoload_enabled;
|
||||||
|
|
@ -527,6 +539,7 @@ void fsensor_update(void)
|
||||||
fsensor_autoload_enabled = autoload_enabled_tmp;
|
fsensor_autoload_enabled = autoload_enabled_tmp;
|
||||||
fsensor_oq_meassure_enabled = oq_meassure_enabled_tmp;
|
fsensor_oq_meassure_enabled = oq_meassure_enabled_tmp;
|
||||||
}
|
}
|
||||||
|
#endif //NEW_FILAMENT_SENSOR
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsensor_setup_interrupt(void)
|
void fsensor_setup_interrupt(void)
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@
|
||||||
// Filament sensor
|
// Filament sensor
|
||||||
#define PAT9125
|
#define PAT9125
|
||||||
#define FILAMENT_SENSOR
|
#define FILAMENT_SENSOR
|
||||||
|
//#define NEW_FILAMENT_SENSOR
|
||||||
|
|
||||||
// Backlash -
|
// Backlash -
|
||||||
//#define BACKLASH_X
|
//#define BACKLASH_X
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue