diff --git a/.travis.yml b/.travis.yml index ed91b0a9b..3e93aad82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ install: script: - GIT_VERSION=$(git rev-parse --short HEAD) - - VARIANTS=$(ls Firmware/variants/1_75_MK2*) + - VARIANTS=$(find Firmware/variants -name "1_75mm_MK2*" -printf "%f\n") - for VARIANT in $VARIANTS; do cp Firmware/variants/${VARIANT} Firmware/Configuration_prusa.h ; arduino --pref build.path=. --verify --verbose-build --board rambo:avr:rambo $PWD/Firmware/Firmware.ino ; diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index ad6fdbcc7..491a446ba 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -10,7 +10,7 @@ // Firmware version #define FW_version "3.1.0" -#define FW_local_variant 8 +#define FW_local_variant 9 #define FW_report_version FW_version " r" STR(FW_local_variant) #define FW_PRUSA3D_MAGIC "PRUSA3DFW" diff --git a/Firmware/Configuration_adv.h b/Firmware/Configuration_adv.h index 68b3649dd..c9d608ce8 100644 --- a/Firmware/Configuration_adv.h +++ b/Firmware/Configuration_adv.h @@ -334,7 +334,7 @@ * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. * Mention @Sebastianv650 on GitHub to alert the author of any issues. */ -//#define LIN_ADVANCE +#define LIN_ADVANCE #ifdef LIN_ADVANCE #define LIN_ADVANCE_K 0 // Unit: mm compression per 1mm/s extruder speed //#define LA_DEBUG // If enabled, this will generate debug information output over USB. diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3ee3ef3fd..9b6027c60 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -2096,7 +2096,9 @@ void gcode_M768() { inline void gcode_M900() { st_synchronize(); - const float newK = code_seen('K') ? code_value_float() : -1; + float newK = code_seen('K') ? code_value_float() : -1; + // [Filter older style K-factor - Don't do anything dumb] + if (newK > 10.0) newK = LIN_ADVANCE_K; if (newK >= 0) extruder_advance_K = newK; SERIAL_ECHO_START; diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index e858ded17..64ef00f94 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -39,7 +39,6 @@ //=========================================================================== block_t *current_block; // A pointer to the block currently being traced - //=========================================================================== //=============================private variables ============================ //=========================================================================== @@ -345,7 +344,7 @@ ISR(TIMER1_COMPA_vect) { void isr() { #ifndef LIN_ADVANCE - // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars) + // Disable Timer1 ISRs and enable global ISR again to capture UART events (incoming chars) DISABLE_TEMPERATURE_INTERRUPT(); // Temperature ISR DISABLE_STEPPER_DRIVER_INTERRUPT(); sei(); @@ -726,6 +725,10 @@ void isr() { } #ifndef LIN_ADVANCE + // Don't run the ISR faster than possible + if (OCR1A < TCNT1 + 16) + OCR1A = TCNT1 + 16; + ENABLE_ISRs(); // Re-enable ISRs #endif } @@ -775,7 +778,7 @@ void isr() { } void advance_isr_scheduler() { - // Disable Timer0 ISRs and enable global ISR again to capture UART events (incoming chars) + // Disable Timer1 ISRs and enable global ISR again to capture UART events (incoming chars) DISABLE_TEMPERATURE_INTERRUPT(); // Temperature ISR DISABLE_STEPPER_DRIVER_INTERRUPT(); sei(); @@ -806,7 +809,8 @@ void isr() { } // Don't run the ISR faster than possible - if (OCR1A < TCNT1 + 16) OCR1A = TCNT1 + 16; + if (OCR1A < TCNT1 + 16) + OCR1A = TCNT1 + 16; // Restore original ISR settings ENABLE_ISRs();