Commit 0b6f1b8f authored by MagoKimbra's avatar MagoKimbra

Same fix

parent 96f7e11c
......@@ -14,14 +14,15 @@
#ifdef __SAM3X8E__
#include "HAL.h"
#include "Fastio_sam.h"
#else
#include <util/delay.h>
#include <avr/eeprom.h>
#include "fastio.h"
#endif
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "fastio.h"
#include "Configuration.h"
#if (ARDUINO >= 100)
......@@ -239,7 +240,9 @@ void Stop();
void filrunout();
#endif
bool IsStopped();
extern bool Running;
inline bool IsRunning() { return Running; }
inline bool IsStopped() { return !Running; }
bool enquecommand(const char *cmd); //put a single ASCII command at the end of the current buffer or return false when it is full
void enquecommands_P(const char *cmd); //put one or many ASCII commands at the end of the current buffer, read from flash
......@@ -291,7 +294,7 @@ extern float home_offset[3];
extern float delta_radius;
extern float delta_diagonal_rod;
#elif defined(Z_DUAL_ENDSTOPS)
extern float z_endstop_adj;
extern float z_endstop_adj;
#endif
#ifdef SCARA
......@@ -303,6 +306,11 @@ extern float max_pos[3];
extern bool axis_known_position[3];
extern float lastpos[4];
extern float zprobe_zoffset;
#ifdef PREVENT_DANGEROUS_EXTRUDE
extern float extrude_min_temp;
#endif
extern int fanSpeed;
#ifdef BARICUDA
......@@ -319,7 +327,7 @@ extern int fanSpeed;
extern bool filament_sensor; //indicates that filament sensor readings should control extrusion
extern float filament_width_meas; //holds the filament diameter as accurately measured
extern signed char measurement_delay[]; //ring buffer to delay measurement
extern int delay_index1, delay_index2; //index into ring buffer
extern int delay_index1, delay_index2; //ring buffer index. used by planner, temperature, and main code
extern float delay_dist; //delay distance counter
extern int meas_delay_cm; //delay distance
#endif
......
This diff is collapsed.
......@@ -195,7 +195,7 @@
#define Y_PROBE_ERROR
#endif
#ifdef Y_PROBE_ERROR
#error The Y axis probing range is to small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
#error The Y axis probing range is too small to fit all the points defined in AUTO_BED_LEVELING_GRID_POINTS
#endif
#undef PROBE_SIZE_X
......
......@@ -61,9 +61,9 @@
#define MSG_FAN_SPEED "Ixoriador"
#define MSG_FLOW "Fluxo"
#define MSG_CONTROL "Control"
#define MSG_MIN " " STR_THERMOMETER " Min"
#define MSG_MAX " " STR_THERMOMETER " Max"
#define MSG_FACTOR " " STR_THERMOMETER " Fact"
#define MSG_MIN LCD_STR_THERMOMETER " Min"
#define MSG_MAX LCD_STR_THERMOMETER " Max"
#define MSG_FACTOR LCD_STR_THERMOMETER " Fact"
#define MSG_IDLEOOZING "Anti oozing"
#define MSG_AUTOTEMP "Autotemp"
#define MSG_ON "On"
......@@ -95,7 +95,7 @@
#define MSG_TEMPERATURE "Temperatura"
#define MSG_MOTION "Movimiento"
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm" STR_h3
#define MSG_VOLUMETRIC_ENABLED "E in mm4"
#define MSG_FILAMENT_SIZE_EXTRUDER "Fil. Dia."
#define MSG_CONTRAST "Contrast"
#define MSG_STORE_EPROM "Alzar Memoria"
......
......@@ -110,9 +110,6 @@ volatile unsigned char block_buffer_tail; // Index of the block to process now
//===========================================================================
//=============================private variables ============================
//===========================================================================
#ifdef PREVENT_DANGEROUS_EXTRUDE
float extrude_min_temp = EXTRUDE_MINTEMP;
#endif
#ifdef XY_FREQUENCY_LIMIT
// Used for the frequency limit
#define MAX_FREQ_TIME (1000000.0/XY_FREQUENCY_LIMIT)
......@@ -513,27 +510,24 @@ float junction_deviation = 0.1;
#ifdef PREVENT_DANGEROUS_EXTRUDE
if (de) {
#ifdef NPR2
if (active_extruder!=1) {
if(degHotend(active_extruder) < extrude_min_temp && !debugDryrun()) {
if (active_extruder != 1)
#endif // NPR2
{
if (degHotend(active_extruder) < extrude_min_temp && !debugDryrun()) {
position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
}
}
#else // NO NPR2
if(degHotend(active_extruder) < extrude_min_temp && !debugDryrun()) {
position[E_AXIS] = target[E_AXIS]; //behave as if the move really took place, but ignore E part
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
}
#endif // NPR2
#ifdef PREVENT_LENGTHY_EXTRUDE
if(labs(de) > axis_steps_per_unit[E_AXIS + active_extruder] * EXTRUDE_MAXLENGTH) {
if (labs(de) > axis_steps_per_unit[E_AXIS + active_extruder] * EXTRUDE_MAXLENGTH) {
#ifdef EASY_LOAD
if (!allow_lengthy_extrude_once) {
#endif
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
de = 0; // no difference
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
#ifdef EASY_LOAD
......@@ -1052,10 +1046,6 @@ void plan_set_e_position(const float &e) {
st_set_e_position(position[E_AXIS]);
}
#ifdef PREVENT_DANGEROUS_EXTRUDE
void set_extrude_min_temp(float temp) { extrude_min_temp = temp; }
#endif
// Calculate the steps/s^2 acceleration rates, based on the mm/s^s
void reset_acceleration_rates() {
for (int i = 0; i < 3 + EXTRUDERS; i++)
......
......@@ -161,10 +161,6 @@ FORCE_INLINE block_t *plan_get_current_block() {
return NULL;
}
#ifdef PREVENT_DANGEROUS_EXTRUDE
void set_extrude_min_temp(float temp);
#endif
void reset_acceleration_rates();
#endif //PLANNER_H
#endif // PLANNER_H
......@@ -438,7 +438,7 @@ void checkExtruderAutoFans()
// Temperature Error Handlers
//
inline void _temp_error(int e, const char *msg1, const char *msg2) {
if (!IsStopped()) {
if (IsRunning()) {
SERIAL_ERROR_START;
if (e >= 0) SERIAL_ERRORLN((int)e);
serialprintPGM(msg1);
......@@ -1255,7 +1255,7 @@ static void set_current_temp_raw() {
// Timer 0 is shared with millies
//
ISR(TIMER0_COMPB_vect) {
//these variables are only accessible from the ISR, but static, so they don't lose their value
//these variables are only accesible from the ISR, but static, so they don't lose their value
static unsigned char temp_count = 0;
static TempState temp_state = StartupDelay;
static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
......
......@@ -826,6 +826,15 @@ static void lcd_prepare_menu() {
}
#endif // DELTA
inline void line_to_current() {
#ifdef DELTA
calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver);
#else
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver);
#endif
}
float move_menu_scale;
static void lcd_move_menu_axis();
......@@ -836,12 +845,7 @@ static void _lcd_move(const char *name, int axis, int min, int max) {
if (min_software_endstops && current_position[axis] < min) current_position[axis] = min;
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
encoderPosition = 0;
#ifdef DELTA
calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver);
#else
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[X_AXIS]/60, active_extruder, active_driver);
#endif
line_to_current();
lcdDrawUpdate = 1;
}
if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
......@@ -850,17 +854,11 @@ static void _lcd_move(const char *name, int axis, int min, int max) {
static void lcd_move_x() { _lcd_move(PSTR("X"), X_AXIS, X_MIN_POS, X_MAX_POS); }
static void lcd_move_y() { _lcd_move(PSTR("Y"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
static void lcd_move_z() { _lcd_move(PSTR("Z"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
static void lcd_move_e() {
if (encoderPosition != 0) {
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
encoderPosition = 0;
#ifdef DELTA
calculate_delta(current_position);
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder, active_driver);
#else
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder, active_driver);
#endif
line_to_current();
lcdDrawUpdate = 1;
}
if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
......
......@@ -378,34 +378,37 @@ static void lcd_implementation_init(
#endif
) {
#if defined(LCD_I2C_TYPE_PCF8575)
#if defined(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#ifdef LCD_I2C_PIN_BL
lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
lcd.setBacklight(HIGH);
#endif
#elif defined(LCD_I2C_TYPE_MCP23017)
#ifdef LCD_I2C_PIN_BL
lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
lcd.setBacklight(HIGH);
#endif
#elif defined(LCD_I2C_TYPE_MCP23017)
lcd.setMCPType(LTI_TYPE_MCP23017);
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
lcd.setBacklight(0); //set all the LEDs off to begin with
#elif defined(LCD_I2C_TYPE_MCP23008)
#elif defined(LCD_I2C_TYPE_MCP23008)
lcd.setMCPType(LTI_TYPE_MCP23008);
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#elif defined(LCD_I2C_TYPE_PCA8574)
lcd.init();
lcd.backlight();
#else
#elif defined(LCD_I2C_TYPE_PCA8574)
lcd.init();
lcd.backlight();
#else
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif
#endif
lcd_set_custom_characters(
#ifdef LCD_PROGRESS_BAR
progress_bar_set
#endif
);
lcd_set_custom_characters(
#ifdef LCD_PROGRESS_BAR
progress_bar_set
#endif
);
lcd.clear();
lcd.clear();
}
static void lcd_implementation_clear() {
......@@ -672,10 +675,10 @@ static void lcd_implementation_status_screen() {
#endif
#if HAS_LCD_FILAMENT_SENSOR
else {
lcd_printPGM(PSTR("D:"));
lcd_printPGM(PSTR("Dia "));
lcd.print(ftostr12ns(filament_width_meas));
lcd_printPGM(PSTR("mm F:"));
lcd.print(itostr3(100.0 * volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
lcd_printPGM(PSTR(" V"));
lcd.print(itostr3(100.0*volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
lcd.print('%');
return;
}
......
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