Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
MagoKimbra committed Jan 18, 2017
2 parents 43f8e9e + 91e8d58 commit aaf7a39
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 105 deletions.
32 changes: 16 additions & 16 deletions MK4duo/src/MK_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2797,8 +2797,8 @@ static void homeaxis(AxisEnum axis) {
#if HAS(TEMP_CHAMBER)
void print_chamberstate() {
SERIAL_M(" CHAMBER: ");
SERIAL_MV(MSG_C, degChamber(), 1);
SERIAL_MV(" /", degTargetChamber(), 1);
SERIAL_MV(MSG_C, thermalManager.degChamber(), 1);
SERIAL_MV(" /", thermalManager.degTargetChamber(), 1);
SERIAL_M(MSG_CAT);
#if ENABLED(CHAMBER_WATTS)
SERIAL_V(((CHAMBER_WATTS) * thermalManager.getChamberPower()) / 127.0);
Expand All @@ -2807,7 +2807,7 @@ static void homeaxis(AxisEnum axis) {
SERIAL_V(thermalManager.getChamberPower());
#endif
#if ENABLED(SHOW_TEMP_ADC_VALUES)
SERIAL_MV(" ADC C:", degChamber(), 1);
SERIAL_MV(" ADC C:", thermalManager.degChamber(), 1);
SERIAL_MV("C->", thermalManager.rawChamberTemp() / OVERSAMPLENR, 1);
#endif
}
Expand All @@ -2816,8 +2816,8 @@ static void homeaxis(AxisEnum axis) {
#if HAS(TEMP_COOLER)
void print_coolerstate() {
SERIAL_M(" COOL: ");
SERIAL_MV(MSG_C, degCooler(), 1);
SERIAL_MV(" /", degTargetCooler(), 1);
SERIAL_MV(MSG_C, thermalManager.degCooler(), 1);
SERIAL_MV(" /", thermalManager.degTargetCooler(), 1);
SERIAL_M(MSG_CAT);
#if ENABLED(COOLER_WATTS)
SERIAL_V(((COOLER_WATTS) * thermalManager.getCoolerPower()) / 127.0);
Expand All @@ -2826,7 +2826,7 @@ static void homeaxis(AxisEnum axis) {
SERIAL_V(thermalManager.getCoolerPower());
#endif
#if ENABLED(SHOW_TEMP_ADC_VALUES)
SERIAL_MV(" ADC C:", degCooler(), 1);
SERIAL_MV(" ADC C:", thermalManager.degCooler(), 1);
SERIAL_MV("C->", thermalManager.rawCoolerTemp() / OVERSAMPLENR, 0);
#endif
}
Expand Down Expand Up @@ -3055,8 +3055,8 @@ inline void wait_heater(bool no_wait_for_cooling = true) {
// Wait for temperature to come close enough
do {
// Target temperature might be changed during the loop
if (theTarget != degTargetChamber())
theTarget = degTargetChamber();
if (theTarget != thermalManager.degTargetChamber())
theTarget = thermalManager.degTargetChamber();

wants_to_heat = thermalManager.isHeatingChamber();

Expand Down Expand Up @@ -3086,7 +3086,7 @@ inline void wait_heater(bool no_wait_for_cooling = true) {

#if TEMP_CHAMBER_RESIDENCY_TIME > 0

float temp_diff = FABS(theTarget - degTargetChamber());
float temp_diff = FABS(theTarget - thermalManager.degTargetChamber());

if (!residency_start_ms) {
// Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time.
Expand Down Expand Up @@ -3126,8 +3126,8 @@ inline void wait_heater(bool no_wait_for_cooling = true) {
// Wait for temperature to come close enough
do {
// Target temperature might be changed during the loop
if (theTarget != degTargetCooler())
theTarget = degTargetCooler();
if (theTarget != thermalManager.degTargetCooler())
theTarget = thermalManager.degTargetCooler();

wants_to_heat = thermalManager.isHeatingCooler();

Expand Down Expand Up @@ -3161,7 +3161,7 @@ inline void wait_heater(bool no_wait_for_cooling = true) {

#if TEMP_COOLER_RESIDENCY_TIME > 0

float temp_diff = FABS(theTarget - degTargetCooler());
float temp_diff = FABS(theTarget - thermalManager.degTargetCooler());

if (!residency_start_ms) {
// Start the TEMP_COOLER_RESIDENCY_TIME timer when we reach target temp for the first time.
Expand Down Expand Up @@ -6969,7 +6969,7 @@ inline void gcode_M122() {
*/
inline void gcode_M141() {
if (DEBUGGING(DRYRUN)) return;
if (code_seen('S')) setTargetChamber(code_value_temp_abs());
if (code_seen('S')) thermalManager.setTargetChamber(code_value_temp_abs());
}
#endif

Expand All @@ -6979,7 +6979,7 @@ inline void gcode_M122() {
*/
inline void gcode_M142() {
if (DEBUGGING(DRYRUN)) return;
if (code_seen('S')) setTargetCooler(code_value_temp_abs());
if (code_seen('S')) thermalManager.setTargetCooler(code_value_temp_abs());
}
#endif

Expand Down Expand Up @@ -7180,7 +7180,7 @@ inline void gcode_M122() {

LCD_MESSAGEPGM(MSG_CHAMBER_HEATING);
bool no_wait_for_cooling = code_seen('S');
if (no_wait_for_cooling || code_seen('R')) setTargetChamber(code_value_temp_abs());
if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetChamber(code_value_temp_abs());

wait_chamber(no_wait_for_cooling);
}
Expand All @@ -7196,7 +7196,7 @@ inline void gcode_M122() {

LCD_MESSAGEPGM(MSG_COOLER_COOLING);
bool no_wait_for_heating = code_seen('S');
if (no_wait_for_heating || code_seen('R')) setTargetCooler(code_value_temp_abs());
if (no_wait_for_heating || code_seen('R')) thermalManager.setTargetCooler(code_value_temp_abs());

wait_cooler(no_wait_for_heating);
}
Expand Down
165 changes: 83 additions & 82 deletions MK4duo/src/boards/7.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,90 +14,91 @@

#define LARGE_FLASH true

#define ORIG_X_STEP_PIN 25
#define ORIG_X_DIR_PIN 23
#define ORIG_X_MIN_PIN 22
#define ORIG_X_MAX_PIN 24
#define ORIG_X_ENABLE_PIN 27

#define ORIG_Y_STEP_PIN 31
#define ORIG_Y_DIR_PIN 33
#define ORIG_Y_MIN_PIN 26
#define ORIG_Y_MAX_PIN 28
#define ORIG_Y_ENABLE_PIN 29

#define ORIG_Z_STEP_PIN 37
#define ORIG_Z_DIR_PIN 39
#define ORIG_Z_MIN_PIN 30
#define ORIG_Z_MAX_PIN 32
#define ORIG_Z_ENABLE_PIN 35

#define ORIG_HEATER_BED_PIN 4
#define ORIG_TEMP_BED_PIN 10

#define ORIG_HEATER_0_PIN 2
#define ORIG_TEMP_0_PIN 8

#define ORIG_HEATER_1_PIN 3
#define ORIG_TEMP_1_PIN 9

#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_2_PIN -1

#define ORIG_E0_STEP_PIN 43
#define ORIG_E0_DIR_PIN 45
#define ORIG_E0_ENABLE_PIN 41

#define ORIG_E1_STEP_PIN 49
#define ORIG_E1_DIR_PIN 47
#define ORIG_E1_ENABLE_PIN 48

#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13
#define ORIG_FAN_PIN 7
#define ORIG_PS_ON_PIN 12
#define KILL_PIN -1
#define SUICIDE_PIN 54 //PIN that has to be turned on right after start, to keep power flowing.
#define SERVO0_PIN 32 // untested

#define ORIG_X_STEP_PIN 25
#define ORIG_X_DIR_PIN 23
#define ORIG_X_MIN_PIN 22
#define ORIG_X_MAX_PIN 24
#define ORIG_X_ENABLE_PIN 27

#define ORIG_Y_STEP_PIN 31
#define ORIG_Y_DIR_PIN 33
#define ORIG_Y_MIN_PIN 26
#define ORIG_Y_MAX_PIN 28
#define ORIG_Y_ENABLE_PIN 29

#define ORIG_Z_STEP_PIN 37
#define ORIG_Z_DIR_PIN 39
#define ORIG_Z_MIN_PIN 30
#define ORIG_Z_MAX_PIN 32
#define ORIG_Z_ENABLE_PIN 35

#define ORIG_HEATER_BED_PIN 4
#define ORIG_TEMP_BED_PIN 10

#define ORIG_HEATER_0_PIN 2
#define ORIG_TEMP_0_PIN 8

#define ORIG_HEATER_1_PIN 3
#define ORIG_TEMP_1_PIN 9

#define ORIG_HEATER_2_PIN -1
#define ORIG_TEMP_2_PIN -1

#define ORIG_E0_STEP_PIN 43
#define ORIG_E0_DIR_PIN 45
#define ORIG_E0_ENABLE_PIN 41

#define ORIG_E1_STEP_PIN 49
#define ORIG_E1_DIR_PIN 47
#define ORIG_E1_ENABLE_PIN 48

#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13
#define ORIG_FAN_PIN 7
#define ORIG_PS_ON_PIN 12
#define KILL_PIN -1
#define SUICIDE_PIN 54 // PIN that has to be turned on right after start, to keep power flowing.

#if ENABLED(ULTRA_LCD)

#define ORIG_BEEPER_PIN 18

#if ENABLED(NEWPANEL)
//arduino pin witch triggers an piezzo beeper
#define ORIG_BEEPER_PIN 18

#define LCD_PINS_RS 20
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 16
#define LCD_PINS_D5 21
#define LCD_PINS_D6 5
#define LCD_PINS_D7 6

//buttons are directly attached
#define BTN_EN1 40
#define BTN_EN2 42
#define BTN_ENC 19 //the click

#define SD_DETECT_PIN 38

#else //old style panel with shift register
//arduino pin witch triggers an piezzo beeper
#define ORIG_BEEPER_PIN 18

//buttons are attached to a shift register
#define SHIFT_CLK 38
#define SHIFT_LD 42
#define SHIFT_OUT 40
#define SHIFT_EN 17

#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 5
#define LCD_PINS_D4 6
#define LCD_PINS_D5 21
#define LCD_PINS_D6 20
#define LCD_PINS_D7 19

#define SD_DETECT_PIN -1
#endif
#endif //ULTRA_LCD

#define LCD_PINS_RS 20
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 16
#define LCD_PINS_D5 21
#define LCD_PINS_D6 5
#define LCD_PINS_D7 6

// buttons are directly attached
#define BTN_EN1 40
#define BTN_EN2 42
#define BTN_ENC 19

#define SD_DETECT_PIN 38

#else // !NEWPANEL - Old style panel with shift register

// buttons are attached to a shift register
#define SHIFT_CLK 38
#define SHIFT_LD 42
#define SHIFT_OUT 40
#define SHIFT_EN 17

#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 5
#define LCD_PINS_D4 6
#define LCD_PINS_D5 21
#define LCD_PINS_D6 20
#define LCD_PINS_D7 19

#define SD_DETECT_PIN -1

#endif // !NEWPANEL

#endif // ULTRA_LCD
2 changes: 1 addition & 1 deletion MK4duo/src/temperature/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ void Temperature::init() {
}
#endif // CHAMBER_MINTEMP
#if ENABLED(CHAMBER_MAXTEMP)
while(analog2tempCooler(chamber_maxttemp_raw) > CHAMBER_MAXTEMP) {
while(analog2tempChamber(chamber_maxttemp_raw) > CHAMBER_MAXTEMP) {
#if CHAMBER_RAW_LO_TEMP < CHAMBER_RAW_HI_TEMP
chamber_maxttemp_raw -= OVERSAMPLENR;
#else
Expand Down
20 changes: 14 additions & 6 deletions MK4duo/src/temperature/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class Temperature {
target_temperature_bed;

#if HAS(TEMP_CHAMBER)
static float current_temperature_chamber = 0.0;
static int target_temperature_chamber = 0,
current_temperature_chamber_raw = 0;
static float current_temperature_chamber;
static int target_temperature_chamber,
current_temperature_chamber_raw;
#endif

#if HAS(TEMP_COOLER)
static float current_temperature_cooler = 0.0;
static int target_temperature_cooler = 0,
current_temperature_cooler_raw = 0;
static float current_temperature_cooler;
static int target_temperature_cooler,
current_temperature_cooler_raw;
#endif

#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
Expand Down Expand Up @@ -266,6 +266,14 @@ class Temperature {

static uint8_t soft_pwm[HOTENDS];

#if HAS(TEMP_CHAMBER)
static uint8_t Temperature::soft_pwm_chamber;
#endif

#if HAS(TEMP_COOLER)
static uint8_t Temperature::soft_pwm_cooler;
#endif

#if ENABLED(FAN_SOFT_PWM)
static uint8_t soft_pwm_fan;
#endif
Expand Down

0 comments on commit aaf7a39

Please sign in to comment.