Skip to content

Commit 3e559d5

Browse files
committedAug 9, 2021
🎨 abs => ABS
2.0.x(edddeduck/Marlin#1wsguede/Marlin_ender_stock#1psmedley/Marlin#1psmedley/Marlin#2zubairahmed01/Marlin#1inib/Marlin#13Evg33/Marlin#220dougbert-b/Marlin#1ultraguts/Marlin#1danandrei96/Marlin#6jrahaim/Marlin#1dgfug/Marlin#5MikkoWrightson/Marlin#1gjrgj/Marlin#1BioGeekJoey/Marlin#1oechslein/Marlin#575mparm920/Marlin#2Mu-L/Marlin#10Vasilius-001/Marlin#1frolbel/Marlin-for-JGAurora-A5#2WilliamRandol/Marlin#1lgdonkers/Marlin#1nwpeckham88/Marlin#1danielo515/Marlin#11fred099/Marlin#6fred099/Marlin#7SilverCory/Marlin#3skyhoshi/Marlin#32r-stiller/Marlin#1Noeljunior/Marlin#12tomas-pecserke/Marlin#12vinivinilos/Marlin#1mikebean233/Marlin#1zxqugn/Marlin#1zipper177/Marlin#31SoongJr/Marlin#430BlackElkX/Marlin#1cerkit/Marlin#1jnazabal/Marlin_stable#1HellWorkshop/Marlin-Ender-3-Conf#2Tymek/Ender-3-Ghost#36tmacinc/Marlin#1guillermopd/Marlin#2TwoRedCells/Marlin#3cociweb/MarlinFW#16innerspacepilot/Marlin#42)+
·
1 parent eb8649b commit 3e559d5

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed
 

‎Marlin/src/feature/probe_temp_comp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
143143
// Sanity check
144144
for (calib_idx = 0; calib_idx < measurements; ++calib_idx) {
145145
// Restrict the max. offset
146-
if (abs(data[calib_idx]) > 2000) {
146+
if (ABS(data[calib_idx]) > 2000) {
147147
SERIAL_ECHOLNPGM("!Invalid Z-offset detected (0-2).");
148148
clear_offsets(tsi);
149149
return false;
150150
}
151151
// Restrict the max. offset difference between two probings
152-
if (calib_idx > 0 && abs(data[calib_idx - 1] - data[calib_idx]) > 800) {
152+
if (calib_idx > 0 && ABS(data[calib_idx - 1] - data[calib_idx]) > 800) {
153153
SERIAL_ECHOLNPGM("!Invalid Z-offset between two probings detected (0-0.8).");
154154
clear_offsets(TSI_PROBE);
155155
return false;

‎Marlin/src/gcode/bedlevel/G35.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ void GcodeSuite::G35() {
130130
// Calculate adjusts
131131
LOOP_S_L_N(i, 1, G35_PROBE_COUNT) {
132132
const float diff = z_measured[0] - z_measured[i],
133-
adjust = abs(diff) < 0.001f ? 0 : diff / threads_factor[(screw_thread - 30) / 10];
133+
adjust = ABS(diff) < 0.001f ? 0 : diff / threads_factor[(screw_thread - 30) / 10];
134134

135135
const int full_turns = trunc(adjust);
136136
const float decimal_part = adjust - float(full_turns);
137137
const int minutes = trunc(decimal_part * 60.0f);
138138

139139
SERIAL_ECHOPGM("Turn ");
140140
SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
141-
SERIAL_ECHOPAIR(" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", abs(full_turns), " turns");
142-
if (minutes) SERIAL_ECHOPAIR(" and ", abs(minutes), " minutes");
141+
SERIAL_ECHOPAIR(" ", (screw_thread & 1) == (adjust > 0) ? "CCW" : "CW", " by ", ABS(full_turns), " turns");
142+
if (minutes) SERIAL_ECHOPAIR(" and ", ABS(minutes), " minutes");
143143
if (ENABLED(REPORT_TRAMMING_MM)) SERIAL_ECHOPAIR(" (", -diff, "mm)");
144144
SERIAL_EOL();
145145
}

‎Marlin/src/lcd/dwin/e3v2/rotary_encoder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
121121
lastEncoderBits = newbutton;
122122
}
123123

124-
if (abs(temp_diff) >= ENCODER_PULSES_PER_STEP) {
124+
if (ABS(temp_diff) >= ENCODER_PULSES_PER_STEP) {
125125
if (temp_diff > 0) temp_diffState = ENCODER_DIFF_CW;
126126
else temp_diffState = ENCODER_DIFF_CCW;
127127

‎Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -624,25 +624,25 @@ void DGUSScreenHandler::ManualAssistLeveling(DGUS_VP_Variable &var, void *val_pt
624624

625625
switch (point_value) {
626626
case 0x0001:
627-
enqueue_corner_move(X_MIN_POS + abs(mks_corner_offsets[0].x),
628-
Y_MIN_POS + abs(mks_corner_offsets[0].y), level_speed);
627+
enqueue_corner_move(X_MIN_POS + ABS(mks_corner_offsets[0].x),
628+
Y_MIN_POS + ABS(mks_corner_offsets[0].y), level_speed);
629629
queue.enqueue_now_P(PSTR("G28Z"));
630630
break;
631631
case 0x0002:
632-
enqueue_corner_move(X_MAX_POS - abs(mks_corner_offsets[1].x),
633-
Y_MIN_POS + abs(mks_corner_offsets[1].y), level_speed);
632+
enqueue_corner_move(X_MAX_POS - ABS(mks_corner_offsets[1].x),
633+
Y_MIN_POS + ABS(mks_corner_offsets[1].y), level_speed);
634634
break;
635635
case 0x0003:
636-
enqueue_corner_move(X_MAX_POS - abs(mks_corner_offsets[2].x),
637-
Y_MAX_POS - abs(mks_corner_offsets[2].y), level_speed);
636+
enqueue_corner_move(X_MAX_POS - ABS(mks_corner_offsets[2].x),
637+
Y_MAX_POS - ABS(mks_corner_offsets[2].y), level_speed);
638638
break;
639639
case 0x0004:
640-
enqueue_corner_move(X_MIN_POS + abs(mks_corner_offsets[3].x),
641-
Y_MAX_POS - abs(mks_corner_offsets[3].y), level_speed);
640+
enqueue_corner_move(X_MIN_POS + ABS(mks_corner_offsets[3].x),
641+
Y_MAX_POS - ABS(mks_corner_offsets[3].y), level_speed);
642642
break;
643643
case 0x0005:
644-
enqueue_corner_move(abs(mks_corner_offsets[4].x),
645-
abs(mks_corner_offsets[4].y), level_speed);
644+
enqueue_corner_move(ABS(mks_corner_offsets[4].x),
645+
ABS(mks_corner_offsets[4].y), level_speed);
646646
break;
647647
}
648648

‎Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) {
121121
// being held down, this allows enough margin for the planner to
122122
// connect segments and even out the motion.
123123
constexpr xyze_feedrate_t max_manual_feedrate = MANUAL_FEEDRATE;
124-
return min(max_manual_feedrate[axis] / 60.0f, abs(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f));
124+
return min(max_manual_feedrate[axis] / 60.0f, ABS(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f));
125125
}
126126

127127
void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) {

‎Marlin/src/lcd/extui/mks_ui/draw_baby_stepping.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
9393
has_adjust_z = 1;
9494
break;
9595
case ID_BABY_STEP_DIST:
96-
if (abs((int)(100 * babystep_dist)) == 1)
96+
if (ABS((int)(100 * babystep_dist)) == 1)
9797
babystep_dist = 0.05;
98-
else if (abs((int)(100 * babystep_dist)) == 5)
98+
else if (ABS((int)(100 * babystep_dist)) == 5)
9999
babystep_dist = 0.1;
100100
else
101101
babystep_dist = 0.01;

‎Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ void filament_dialog_handle() {
519519

520520
if (uiCfg.filament_load_heat_flg) {
521521
const celsius_t diff = thermalManager.wholeDegHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
522-
if (abs(diff) < 2 || diff > 0) {
522+
if (ABS(diff) < 2 || diff > 0) {
523523
uiCfg.filament_load_heat_flg = false;
524524
lv_clear_dialog();
525525
lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
@@ -535,7 +535,7 @@ void filament_dialog_handle() {
535535

536536
if (uiCfg.filament_unload_heat_flg) {
537537
const celsius_t diff = thermalManager.wholeDegHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
538-
if (abs(diff) < 2 || diff > 0) {
538+
if (ABS(diff) < 2 || diff > 0) {
539539
uiCfg.filament_unload_heat_flg = false;
540540
lv_clear_dialog();
541541
lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED);

‎Marlin/src/lcd/extui/mks_ui/draw_extrusion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
8989
disp_extru_amount();
9090
break;
9191
case ID_E_STEP:
92-
switch (abs(uiCfg.extruStep)) {
92+
switch (ABS(uiCfg.extruStep)) {
9393
case 1: uiCfg.extruStep = 5; break;
9494
case 5: uiCfg.extruStep = 10; break;
9595
case 10: uiCfg.extruStep = 1; break;

‎Marlin/src/lcd/extui/mks_ui/draw_filament_change.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
5050
switch (obj->mks_obj_id) {
5151
case ID_FILAMNT_IN:
5252
uiCfg.filament_load_heat_flg = true;
53-
if (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
53+
if (ABS(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
5454
|| gCfgItems.filament_limit_temp <= thermalManager.wholeDegHotend(uiCfg.extruderIndex)) {
5555
lv_clear_filament_change();
5656
lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
@@ -67,7 +67,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
6767
case ID_FILAMNT_OUT:
6868
uiCfg.filament_unload_heat_flg = true;
6969
if (thermalManager.degTargetHotend(uiCfg.extruderIndex)
70-
&& (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
70+
&& (ABS(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
7171
|| thermalManager.wholeDegHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temp)
7272
) {
7373
lv_clear_filament_change();

‎Marlin/src/lcd/extui/mks_ui/draw_move_motor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
7575

7676
switch (obj->mks_obj_id) {
7777
case ID_M_STEP:
78-
if (abs(10 * (int)uiCfg.move_dist) == 100)
78+
if (ABS(10 * (int)uiCfg.move_dist) == 100)
7979
uiCfg.move_dist = 0.1;
8080
else
8181
uiCfg.move_dist *= 10.0f;

‎Marlin/src/lcd/menu/menu_bed_corners.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ constexpr int lco[] = LEVEL_CORNERS_LEVELING_ORDER;
8787
constexpr bool level_corners_3_points = COUNT(lco) == 2;
8888
static_assert(level_corners_3_points || COUNT(lco) == 4, "LEVEL_CORNERS_LEVELING_ORDER must have exactly 2 or 4 corners.");
8989

90-
constexpr int lcodiff = abs(lco[0] - lco[1]);
90+
constexpr int lcodiff = ABS(lco[0] - lco[1]);
9191
static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two LEVEL_CORNERS_LEVELING_ORDER corners must be on the same edge.");
9292

9393
constexpr int nr_edge_points = level_corners_3_points ? 3 : 4;

0 commit comments

Comments
 (0)
Please sign in to comment.