From 241c4cc86cf219476541d1f6e3276669cb520c6b Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Tue, 22 Feb 2022 18:03:20 +0100 Subject: [PATCH] Remove dead code --- Firmware/fsensor.cpp | 31 +++---------------------------- Firmware/fsensor.h | 3 --- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index 5fc1b93d7..a83c7b1a9 100755 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -15,6 +15,8 @@ #include "temperature.h" #include "config.h" +#include "Filament_sensor.h" //temporary + //! @name Basic parameters //! @{ #define FSENSOR_CHUNK_LEN 1.25 //!< filament sensor chunk length (mm) @@ -34,15 +36,6 @@ const char ERRMSG_PAT9125_NOT_RESP[] PROGMEM = "PAT9125 not responding (%d)!\n"; -// PJ7 can not be used (does not have PinChangeInterrupt possibility) -#define FSENSOR_INT_PIN 75 //!< filament sensor interrupt pin PJ4 -#define FSENSOR_INT_PIN_MASK 0x10 //!< filament sensor interrupt pin mask (bit4) -#define FSENSOR_INT_PIN_PIN_REG PINJ // PIN register @ PJ4 -#define FSENSOR_INT_PIN_VECT PCINT1_vect // PinChange ISR @ PJ4 -#define FSENSOR_INT_PIN_PCMSK_REG PCMSK1 // PinChangeMaskRegister @ PJ4 -#define FSENSOR_INT_PIN_PCMSK_BIT PCINT13 // PinChange Interrupt / PinChange Enable Mask @ PJ4 -#define FSENSOR_INT_PIN_PCICR_BIT PCIE1 // PinChange Interrupt Enable / Flag @ PJ4 - //! enabled = initialized and sampled every chunk event bool fsensor_enabled = true; //! runout watching is done in fsensor_update (called from main loop) @@ -51,7 +44,6 @@ bool fsensor_watch_runout = true; bool fsensor_not_responding = false; #ifdef PAT9125 -uint8_t fsensor_int_pin_old = 0; //! optical checking "chunk lenght" (already in steps) int16_t fsensor_chunk_len = 0; //! number of errors, updated in ISR @@ -125,13 +117,6 @@ bool bIRsensorStateFlag=false; ShortTimer tIRsensorCheckTimer; #endif //IR_SENSOR_ANALOG -void fsensor_stop_and_save_print(void) -{ - puts_P(PSTR("fsensor_stop_and_save_print")); - stop_and_save_print_to_ram(0, 0); - fsensor_watch_runout = false; -} - #ifdef PAT9125 // Reset all internal counters to zero, including stepper callbacks void fsensor_reset_err_cnt() @@ -148,16 +133,6 @@ void fsensor_set_axis_steps_per_unit(float u) #endif -void fsensor_restore_print_and_continue(void) -{ - puts_P(PSTR("fsensor_restore_print_and_continue")); - fsensor_watch_runout = true; -#ifdef PAT9125 - fsensor_reset_err_cnt(); -#endif - restore_print_from_ram_and_continue(0); -} - // fsensor_checkpoint_print cuts the current print job at the current position, // allowing new instructions to be inserted in the middle void fsensor_checkpoint_print(void) @@ -255,7 +230,7 @@ bool fsensor_enable(bool bUpdateEEPROM) } #else // PAT9125 #ifdef IR_SENSOR_ANALOG - if(!fsensor_IR_check()) + if(!fsensor_IR_check(fsensor.getVoltRaw())) { bUpdateEEPROM=true; fsensor_enabled=false; diff --git a/Firmware/fsensor.h b/Firmware/fsensor.h index b305d31c9..a4bb29131 100755 --- a/Firmware/fsensor.h +++ b/Firmware/fsensor.h @@ -19,9 +19,6 @@ extern uint8_t fsensor_softfail; //! @name save restore printing //! @{ -extern void fsensor_stop_and_save_print(void); -//! restore print - restore position and heatup to original temperature -extern void fsensor_restore_print_and_continue(void); //! split the current gcode stream to insert new instructions extern void fsensor_checkpoint_print(void); //! @}