Commit a3f74efe authored by Simone Primarosa's avatar Simone Primarosa

Merge pull request #5 from MagoKimbra/master

Update from master
parents 9cccb96c 971c0ac5
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
### Version 4.1.5 ### Version 4.1.5
* Implemented FAST_PWM_FAN and FAN_SOFT_PWM also for other fan that can be added in configuration_adv file. * Implemented FAST_PWM_FAN and FAN_SOFT_PWM also for other fan that can be added in configuration_adv file.
* Added the ability to set a min speed to the fan that can be added in configuration_adv file. * Added the ability to set a min speed to the fan that can be added in configuration_adv file.
* Critical stepper motor frequency bugfix
* General bugfix * General bugfix
### Version 4.1.4 ### Version 4.1.4
......
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
//This is for controlling a fan to cool down the stepper drivers //This is for controlling a fan to cool down the stepper drivers
//it will turn on when any driver is enabled //it will turn on when any driver is enabled
//and turn off after the set amount of seconds from last driver being disabled again //and turn off after the set amount of seconds from last driver being disabled again
#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable) #define CONTROLLERFAN_PIN -1 // Pin used for the fan to cool controller (-1 to disable)
#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run #define CONTROLLERFAN_SECS 60 // How many seconds, after all motors were disabled, the fan should run
#define CONTROLLERFAN_SPEED 255 // 255 = full speed #define CONTROLLERFAN_SPEED 255 // 255 = full speed
#define CONTROLLERFAN_MIN_SPEED 0 #define CONTROLLERFAN_MIN_SPEED 0
// When first starting the main fan, run it at full speed for the // When first starting the main fan, run it at full speed for the
...@@ -333,16 +333,13 @@ ...@@ -333,16 +333,13 @@
// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process // Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
// it can e.g. be used to change z-positions in the print startup phase in real-time // it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops! // does not respect endstops!
#ifdef CARTESIAN
#define BABYSTEPPING //On cartesian printer this can be enabled as default as fully working
#else
//#define BABYSTEPPING //#define BABYSTEPPING
#endif
#if ENABLED(BABYSTEPPING) #if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions #define BABYSTEP_XY // not only z, but also XY in the menu. more clutter, more functions
//not implemented for CoreXY and deltabots! // not implemented for CoreXY and deltabots!
#define BABYSTEP_INVERT_Z false //true for inverse movements in Z #define BABYSTEP_INVERT_Z false // true for inverse movements in Z
#define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements #define BABYSTEP_Z_MULTIPLICATOR 2 // faster z movements
#endif #endif
// extruder advance constant (s2/mm3) // extruder advance constant (s2/mm3)
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family) #define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family)
#endif #endif
#if ENABLED(PANEL_ONE) #if ENABLED(PANEL_ONE)
#define SDSUPPORT #define SDSUPPORT
#define ULTIMAKERCONTROLLER #define ULTIMAKERCONTROLLER
...@@ -98,7 +97,6 @@ ...@@ -98,7 +97,6 @@
/** /**
* I2C PANELS * I2C PANELS
*/ */
#if ENABLED(LCD_I2C_SAINSMART_YWROBOT) #if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home ) // This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
// Make sure it is placed in the Arduino libraries directory. // Make sure it is placed in the Arduino libraries directory.
...@@ -368,7 +366,7 @@ ...@@ -368,7 +366,7 @@
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
// Z_RAISE_AFTER_PROBING is not for all probes. Be sure that it is zero in that cases // Z_RAISE_AFTER_PROBING is not for all probes. Be sure that it is zero in that cases
#if (NUM_SERVOS == 0) && !defined(Z_PROBE_SLED) #if (NUM_SERVOS == 0) && DISABLED(Z_PROBE_SLED)
#undef Z_RAISE_AFTER_PROBING #undef Z_RAISE_AFTER_PROBING
#define Z_RAISE_AFTER_PROBING 0 #define Z_RAISE_AFTER_PROBING 0
#endif #endif
...@@ -379,13 +377,20 @@ ...@@ -379,13 +377,20 @@
*/ */
#define SERVO_LEVELING (defined(SERVO_ENDSTOPS) && defined(DEACTIVATE_SERVOS_AFTER_MOVE)) #define SERVO_LEVELING (defined(SERVO_ENDSTOPS) && defined(DEACTIVATE_SERVOS_AFTER_MOVE))
/** /**
* Sled Options * Sled Options
*/ */
#if ENABLED(Z_PROBE_SLED) #if ENABLED(Z_PROBE_SLED)
#define Z_SAFE_HOMING #define Z_SAFE_HOMING
#endif #endif
/**
* Babystepping
*/
#if ENABLED(CARTESIAN)
#define BABYSTEPPING // On Cartesian printer this can be enabled as default as fully working
#endif
/** /**
* MAX_STEP_FREQUENCY differs for TOSHIBA OR ARDUINO DUE OR ARDUINO MEGA * MAX_STEP_FREQUENCY differs for TOSHIBA OR ARDUINO DUE OR ARDUINO MEGA
*/ */
...@@ -431,8 +436,10 @@ ...@@ -431,8 +436,10 @@
#undef SD_DETECT_INVERTED #undef SD_DETECT_INVERTED
#endif #endif
// Power Signal Control Definitions /**
// By default use Normal definition * Power Signal Control Definitions
* By default use Normal definition
*/
#ifndef POWER_SUPPLY #ifndef POWER_SUPPLY
#define POWER_SUPPLY 0 #define POWER_SUPPLY 0
#endif #endif
...@@ -524,7 +531,7 @@ ...@@ -524,7 +531,7 @@
#else #else
#define ARRAY_BY_EXTRUDER(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) { v1 } #define ARRAY_BY_EXTRUDER(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) { v1 }
#endif #endif
#define ARRAY_BY_EXTRUDERS(v1) ARRAY_BY_EXTRUDER(v1, v1, v1, v1, v1, v1, v1, v1, v1, v1) #define ARRAY_BY_EXTRUDERS(v1) ARRAY_BY_EXTRUDER(v1, v1, v1, v1, v1, v1, v1, v1, v1, v1)
/** /**
...@@ -673,8 +680,14 @@ ...@@ -673,8 +680,14 @@
#endif #endif
#endif #endif
/**
* Buzzer
*/
#define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER)) #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER))
/**
* Servos
*/
#if HAS_SERVOS #if HAS_SERVOS
#if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0 #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
#define HAS_SERVO_ENDSTOPS true #define HAS_SERVO_ENDSTOPS true
......
...@@ -955,7 +955,7 @@ void tp_init() { ...@@ -955,7 +955,7 @@ void tp_init() {
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
ANALOG_SELECT(FILWIDTH_PIN); ANALOG_SELECT(FILWIDTH_PIN);
#endif #endif
#if HAS_CONTROLLERFAN #if HAS_CONTROLLERFAN
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
...@@ -965,7 +965,7 @@ void tp_init() { ...@@ -965,7 +965,7 @@ void tp_init() {
soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2; soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2;
#endif #endif
#endif #endif
#if HAS_AUTO_FAN_0 #if HAS_AUTO_FAN_0
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
...@@ -990,13 +990,12 @@ void tp_init() { ...@@ -990,13 +990,12 @@ void tp_init() {
setPwmFrequency(EXTRUDER_3_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 setPwmFrequency(EXTRUDER_3_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif #endif
#endif #endif
#if ENABLED(FAN_SOFT_PWM) #if ENABLED(FAN_SOFT_PWM)
#if HAS_AUTO_FAN #if HAS_AUTO_FAN
soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2; soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2;
#endif #endif
#endif #endif
#if HAS_POWER_CONSUMPTION_SENSOR #if HAS_POWER_CONSUMPTION_SENSOR
ANALOG_SELECT(POWER_CONSUMPTION_PIN); ANALOG_SELECT(POWER_CONSUMPTION_PIN);
...@@ -1444,10 +1443,10 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1444,10 +1443,10 @@ ISR(TIMER0_COMPB_vect) {
} }
#endif #endif
#endif #endif
pwm_count += BIT(SOFT_PWM_SCALE); pwm_count += BIT(SOFT_PWM_SCALE);
pwm_count &= 0x7f; pwm_count &= 0x7f;
#else // SLOW_PWM_HEATERS #else // SLOW_PWM_HEATERS
/* /*
* SLOW PWM HEATERS * SLOW PWM HEATERS
...@@ -1571,7 +1570,7 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1571,7 +1570,7 @@ ISR(TIMER0_COMPB_vect) {
if ((pwm_count % 64) == 0) { if ((pwm_count % 64) == 0) {
slow_pwm_count++; slow_pwm_count++;
slow_pwm_count &= 0x7f; slow_pwm_count &= 0x7f;
// HOTEND 0 // HOTEND 0
if (state_timer_heater_0 > 0) state_timer_heater_0--; if (state_timer_heater_0 > 0) state_timer_heater_0--;
#if HOTENDS > 1 // HOTEND 1 #if HOTENDS > 1 // HOTEND 1
...@@ -1587,7 +1586,7 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1587,7 +1586,7 @@ ISR(TIMER0_COMPB_vect) {
if (state_timer_heater_BED > 0) state_timer_heater_BED--; if (state_timer_heater_BED > 0) state_timer_heater_BED--;
#endif #endif
} // (pwm_count % 64) == 0 } // (pwm_count % 64) == 0
#endif // SLOW_PWM_HEATERS #endif // SLOW_PWM_HEATERS
#define SET_ADMUX_ADCSRA(pin) ADMUX = BIT(REFS0) | (pin & 0x07); ADCSRA |= BIT(ADSC) #define SET_ADMUX_ADCSRA(pin) ADMUX = BIT(REFS0) | (pin & 0x07); ADCSRA |= BIT(ADSC)
...@@ -1599,6 +1598,7 @@ ISR(TIMER0_COMPB_vect) { ...@@ -1599,6 +1598,7 @@ ISR(TIMER0_COMPB_vect) {
// Prepare or measure a sensor, each one every 14th frame // Prepare or measure a sensor, each one every 14th frame
switch(temp_state) { switch(temp_state) {
case PrepareTemp_0: case PrepareTemp_0:
#if HAS_TEMP_0 #if HAS_TEMP_0
START_ADC(TEMP_0_PIN); START_ADC(TEMP_0_PIN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment