|
@@ -4074,14 +4074,14 @@ inline void gcode_M226() {
|
4074
|
4074
|
#if NUM_SERVOS > 0
|
4075
|
4075
|
|
4076
|
4076
|
/**
|
4077
|
|
- * M280: Set servo position absolute. P: servo index, S: angle or microseconds
|
|
4077
|
+ * M280: Get or set servo position. P<index> S<angle>
|
4078
|
4078
|
*/
|
4079
|
4079
|
inline void gcode_M280() {
|
4080
|
|
- int servo_index = code_seen('P') ? code_value() : -1;
|
|
4080
|
+ int servo_index = code_seen('P') ? code_value_short() : -1;
|
4081
|
4081
|
int servo_position = 0;
|
4082
|
4082
|
if (code_seen('S')) {
|
4083
|
|
- servo_position = code_value();
|
4084
|
|
- if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
|
|
4083
|
+ servo_position = code_value_short();
|
|
4084
|
+ if (servo_index >= 0 && servo_index < NUM_SERVOS) {
|
4085
|
4085
|
Servo *srv = &servo[servo_index];
|
4086
|
4086
|
#if SERVO_LEVELING
|
4087
|
4087
|
srv->attach(0);
|
|
@@ -5650,10 +5650,6 @@ void clamp_to_software_endstops(float target[3]) {
|
5650
|
5650
|
|
5651
|
5651
|
#ifdef MESH_BED_LEVELING
|
5652
|
5652
|
|
5653
|
|
- #if !defined(MIN)
|
5654
|
|
- #define MIN(_v1, _v2) (((_v1) < (_v2)) ? (_v1) : (_v2))
|
5655
|
|
- #endif // ! MIN
|
5656
|
|
-
|
5657
|
5653
|
// This function is used to split lines on mesh borders so each segment is only part of one mesh area
|
5658
|
5654
|
void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_rate, const uint8_t &extruder, uint8_t x_splits=0xff, uint8_t y_splits=0xff)
|
5659
|
5655
|
{
|
|
@@ -5666,10 +5662,10 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
|
5666
|
5662
|
int piy = mbl.select_y_index(current_position[Y_AXIS]);
|
5667
|
5663
|
int ix = mbl.select_x_index(x);
|
5668
|
5664
|
int iy = mbl.select_y_index(y);
|
5669
|
|
- pix = MIN(pix, MESH_NUM_X_POINTS-2);
|
5670
|
|
- piy = MIN(piy, MESH_NUM_Y_POINTS-2);
|
5671
|
|
- ix = MIN(ix, MESH_NUM_X_POINTS-2);
|
5672
|
|
- iy = MIN(iy, MESH_NUM_Y_POINTS-2);
|
|
5665
|
+ pix = min(pix, MESH_NUM_X_POINTS - 2);
|
|
5666
|
+ piy = min(piy, MESH_NUM_Y_POINTS - 2);
|
|
5667
|
+ ix = min(ix, MESH_NUM_X_POINTS - 2);
|
|
5668
|
+ iy = min(iy, MESH_NUM_Y_POINTS - 2);
|
5673
|
5669
|
if (pix == ix && piy == iy) {
|
5674
|
5670
|
// Start and end on same mesh square
|
5675
|
5671
|
plan_buffer_line(x, y, z, e, feed_rate, extruder);
|