Commit ac4ce4e2 authored by MagoKimbra's avatar MagoKimbra

Fix

parent 14af5afb
...@@ -3715,8 +3715,7 @@ inline void gcode_G28() { ...@@ -3715,8 +3715,7 @@ inline void gcode_G28() {
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp);
if (eqnBVector[ind] - z_tmp < min_diff) NOMORE(min_diff, eqnBVector[ind] - z_tmp);
min_diff = eqnBVector[ind] - z_tmp;
if (diff >= 0.0) if (diff >= 0.0)
ECHO_M(" +"); // Include + for column alignment ECHO_M(" +"); // Include + for column alignment
...@@ -6138,7 +6137,7 @@ inline void gcode_M400() { st_synchronize(); } ...@@ -6138,7 +6137,7 @@ inline void gcode_M400() { st_synchronize(); }
*/ */
inline void gcode_M405() { inline void gcode_M405() {
if (code_seen('D')) meas_delay_cm = code_value(); if (code_seen('D')) meas_delay_cm = code_value();
if (meas_delay_cm > MAX_MEASUREMENT_DELAY) meas_delay_cm = MAX_MEASUREMENT_DELAY; NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY);
if (delay_index2 == -1) { //initialize the ring buffer if it has not been done since startup if (delay_index2 == -1) { //initialize the ring buffer if it has not been done since startup
int temp_ratio = widthFil_to_size_ratio(); int temp_ratio = widthFil_to_size_ratio();
......
...@@ -142,7 +142,7 @@ static void lcd_status_screen(); ...@@ -142,7 +142,7 @@ static void lcd_status_screen();
encoderRateMultiplierEnabled = false; \ encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \ if (encoderPosition > 0x8000) encoderPosition = 0; \
uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ NOMORE(currentMenuViewOffset, encoderLine); \
uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
bool wasClicked = LCD_CLICKED, itemSelected; \ bool wasClicked = LCD_CLICKED, itemSelected; \
bool wasBackClicked = LCD_BACK_CLICKED; \ bool wasBackClicked = LCD_BACK_CLICKED; \
...@@ -157,7 +157,7 @@ static void lcd_status_screen(); ...@@ -157,7 +157,7 @@ static void lcd_status_screen();
encoderRateMultiplierEnabled = false; \ encoderRateMultiplierEnabled = false; \
if (encoderPosition > 0x8000) encoderPosition = 0; \ if (encoderPosition > 0x8000) encoderPosition = 0; \
uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ NOMORE(currentMenuViewOffset, encoderLine); \
uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \
bool wasClicked = LCD_CLICKED, itemSelected; \ bool wasClicked = LCD_CLICKED, itemSelected; \
for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \ for (uint8_t _drawLineNr = 0; _drawLineNr < LCD_HEIGHT; _drawLineNr++, _lineNr++) { \
...@@ -957,8 +957,8 @@ static void _lcd_move(const char* name, AxisEnum axis, int min, int max) { ...@@ -957,8 +957,8 @@ static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
if (encoderPosition != 0) { if (encoderPosition != 0) {
refresh_cmd_timeout(); refresh_cmd_timeout();
current_position[axis] += float((int)encoderPosition) * move_menu_scale; current_position[axis] += float((int)encoderPosition) * move_menu_scale;
if (SOFTWARE_MIN_ENDSTOPS && current_position[axis] < min) current_position[axis] = min; if (SOFTWARE_MIN_ENDSTOPS) NOLESS(current_position[axis], min);
if (SOFTWARE_MAX_ENDSTOPS && current_position[axis] > max) current_position[axis] = max; if (SOFTWARE_MAX_ENDSTOPS) NOMORE(current_position[axis], max);
encoderPosition = 0; encoderPosition = 0;
line_to_current(manual_feedrate[axis]); line_to_current(manual_feedrate[axis]);
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
......
...@@ -372,7 +372,7 @@ void plan_init() { ...@@ -372,7 +372,7 @@ void plan_init() {
block_t* block = &block_buffer[block_index]; block_t* block = &block_buffer[block_index];
if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) { if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS]) {
float se = (float)block->steps[E_AXIS] / block->step_event_count * block->nominal_speed; // mm/sec; float se = (float)block->steps[E_AXIS] / block->step_event_count * block->nominal_speed; // mm/sec;
if (se > high) high = se; NOLESS(high, se);
} }
block_index = next_block_index(block_index); block_index = next_block_index(block_index);
} }
......
...@@ -204,8 +204,7 @@ double r8mat_amax(int m, int n, double a[]) ...@@ -204,8 +204,7 @@ double r8mat_amax(int m, int n, double a[])
double value = r8_abs(a[0 + 0 * m]); double value = r8_abs(a[0 + 0 * m]);
for (int j = 0; j < n; j++) { for (int j = 0; j < n; j++) {
for (int i = 0; i < m; i++) { for (int i = 0; i < m; i++) {
if (value < r8_abs(a[i + j * m])) NOLESS(value, r8_abs(a[i + j * m]));
value = r8_abs(a[i + j * m]);
} }
} }
return value; return value;
......
...@@ -307,8 +307,8 @@ void checkHitEndstops() { ...@@ -307,8 +307,8 @@ void checkHitEndstops() {
} }
} }
#if ENABLED(COREXY) || ENABLED(COREXZ) #if MECH(COREXY) || MECH(COREXZ)
#if ENABLED(COREXY) #if MECH(COREXY)
#define CORE_AXIS_2 B_AXIS #define CORE_AXIS_2 B_AXIS
#else #else
#define CORE_AXIS_2 C_AXIS #define CORE_AXIS_2 C_AXIS
...@@ -340,7 +340,7 @@ inline void update_endstops() { ...@@ -340,7 +340,7 @@ inline void update_endstops() {
// TEST_ENDSTOP: test the old and the current status of an endstop // TEST_ENDSTOP: test the old and the current status of an endstop
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP)) #define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP) && TEST(old_endstop_bits, ENDSTOP))
#if ENABLED(COREXY) || ENABLED(COREXZ) #if MECH(COREXY) || MECH(COREXZ)
#define _SET_TRIGSTEPS(AXIS) do { \ #define _SET_TRIGSTEPS(AXIS) do { \
CRITICAL_SECTION_START; \ CRITICAL_SECTION_START; \
...@@ -368,7 +368,7 @@ inline void update_endstops() { ...@@ -368,7 +368,7 @@ inline void update_endstops() {
} \ } \
} while(0) } while(0)
#if ENABLED(COREXY) || ENABLED(COREXZ) #if MECH(COREXY) || MECH(COREXZ)
// Head direction in -X axis for CoreXY and CoreXZ bots. // Head direction in -X axis for CoreXY and CoreXZ bots.
// If Delta1 == -Delta2, the movement is only in Y or Z axis // If Delta1 == -Delta2, the movement is only in Y or Z axis
if ((current_block->steps[A_AXIS] != current_block->steps[CORE_AXIS_2]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, CORE_AXIS_2))) { if ((current_block->steps[A_AXIS] != current_block->steps[CORE_AXIS_2]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, CORE_AXIS_2))) {
...@@ -690,7 +690,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -690,7 +690,7 @@ ISR(TIMER1_COMPA_vect) {
if (check_endstops) update_endstops(); if (check_endstops) update_endstops();
// Take multiple steps per interrupt (For high speed moves) // Take multiple steps per interrupt (For high speed moves)
for (int8_t i = 0; i < step_loops; i++) { for (uint8_t i = 0; i < step_loops; i++) {
MKSERIAL.checkRx(); // Check for serial chars. MKSERIAL.checkRx(); // Check for serial chars.
...@@ -706,7 +706,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -706,7 +706,7 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
long dir = TEST(out_bits, E_AXIS) ? -1 : 1; long dir = TEST(out_bits, E_AXIS) ? -1 : 1;
for (int8_t j = 0; j < DRIVER_EXTRUDERS; j++) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
counter_m[j] += current_block->mix_steps[j]; counter_m[j] += current_block->mix_steps[j];
if (counter_m[j] > 0) { if (counter_m[j] > 0) {
counter_m[j] -= current_block->step_event_count; counter_m[j] -= current_block->step_event_count;
...@@ -734,7 +734,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -734,7 +734,7 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
counter_e += current_block->steps[E_AXIS]; counter_e += current_block->steps[E_AXIS];
if (counter_e > 0) { if (counter_e > 0) {
for (int8_t j = 0; j < DRIVER_EXTRUDERS; j++) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
counter_m[j] += current_block->mix_steps[j]; counter_m[j] += current_block->mix_steps[j];
if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN); if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN);
} }
...@@ -757,7 +757,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -757,7 +757,7 @@ ISR(TIMER1_COMPA_vect) {
STEP_END(z, Z); STEP_END(z, Z);
#if DISABLED(ADVANCE) #if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
for (int8_t j = 0; j < DRIVER_EXTRUDERS; j++) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
if (counter_m[j] > 0) { if (counter_m[j] > 0) {
counter_m[j] -= current_block->step_event_count; counter_m[j] -= current_block->step_event_count;
En_STEP_WRITE(j, INVERT_E_STEP_PIN); En_STEP_WRITE(j, INVERT_E_STEP_PIN);
......
...@@ -702,7 +702,7 @@ void manage_heater() { ...@@ -702,7 +702,7 @@ void manage_heater() {
// the nominal filament diameter then square it to get an area // the nominal filament diameter then square it to get an area
meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY); meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY);
float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2); float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2);
if (vm < 0.01) vm = 0.01; NOLESS(vm, 0.01);
volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm; volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
} }
#endif //FILAMENT_SENSOR #endif //FILAMENT_SENSOR
...@@ -898,7 +898,7 @@ static void updateTemperaturesFromRawValues() { ...@@ -898,7 +898,7 @@ static void updateTemperaturesFromRawValues() {
int widthFil_to_size_ratio() { int widthFil_to_size_ratio() {
float temp = filament_width_meas; float temp = filament_width_meas;
if (temp < MEASURED_LOWER_LIMIT) temp = filament_width_nominal; //assume sensor cut out if (temp < MEASURED_LOWER_LIMIT) temp = filament_width_nominal; //assume sensor cut out
else if (temp > MEASURED_UPPER_LIMIT) temp = MEASURED_UPPER_LIMIT; else NOMORE(temp, MEASURED_UPPER_LIMIT);
return filament_width_nominal / temp * 100; return filament_width_nominal / temp * 100;
} }
......
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