Merge pull request #2044 from thinkyhead/fix_servos_too

Make some z probe and servo code tweaks
This commit is contained in:
Scott Lahteine 2015-05-10 20:10:42 -07:00
commit 52c0696e44
3 changed files with 22 additions and 24 deletions

View File

@ -4074,14 +4074,14 @@ inline void gcode_M226() {
#if NUM_SERVOS > 0
/**
* M280: Set servo position absolute. P: servo index, S: angle or microseconds
* M280: Get or set servo position. P<index> S<angle>
*/
inline void gcode_M280() {
int servo_index = code_seen('P') ? code_value() : -1;
int servo_index = code_seen('P') ? code_value_short() : -1;
int servo_position = 0;
if (code_seen('S')) {
servo_position = code_value();
if ((servo_index >= 0) && (servo_index < NUM_SERVOS)) {
servo_position = code_value_short();
if (servo_index >= 0 && servo_index < NUM_SERVOS) {
Servo *srv = &servo[servo_index];
#if SERVO_LEVELING
srv->attach(0);
@ -5650,10 +5650,6 @@ void clamp_to_software_endstops(float target[3]) {
#ifdef MESH_BED_LEVELING
#if !defined(MIN)
#define MIN(_v1, _v2) (((_v1) < (_v2)) ? (_v1) : (_v2))
#endif // ! MIN
// This function is used to split lines on mesh borders so each segment is only part of one mesh area
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)
{
@ -5666,10 +5662,10 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_
int piy = mbl.select_y_index(current_position[Y_AXIS]);
int ix = mbl.select_x_index(x);
int iy = mbl.select_y_index(y);
pix = MIN(pix, MESH_NUM_X_POINTS-2);
piy = MIN(piy, MESH_NUM_Y_POINTS-2);
ix = MIN(ix, MESH_NUM_X_POINTS-2);
iy = MIN(iy, MESH_NUM_Y_POINTS-2);
pix = min(pix, MESH_NUM_X_POINTS - 2);
piy = min(piy, MESH_NUM_Y_POINTS - 2);
ix = min(ix, MESH_NUM_X_POINTS - 2);
iy = min(iy, MESH_NUM_Y_POINTS - 2);
if (pix == ix && piy == iy) {
// Start and end on same mesh square
plan_buffer_line(x, y, z, e, feed_rate, extruder);

View File

@ -190,6 +190,7 @@
#endif
#if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
#undef Z_PROBE_PIN
#define Z_PROBE_PIN -1
#endif

View File

@ -48,9 +48,9 @@
#define Z_ENABLE_PIN 10
#define Z_STOP_PIN 2
#define E0_STEP_PIN 24
#define E0_DIR_PIN 21
#define E0_ENABLE_PIN 10
#define E0_STEP_PIN 24
#define E0_DIR_PIN 21
#define E0_ENABLE_PIN 10
// future proofing
#define __FS 20
@ -58,15 +58,15 @@
#define __GS 18
#define __GD 13
#define UNUSED_PWM 14 // PWM on LEFT connector
#define UNUSED_PWM 14 // PWM on LEFT connector
#define E1_STEP_PIN -1 // 21
#define E1_DIR_PIN -1 // 20
#define E1_ENABLE_PIN -1 // 19
#define E1_STEP_PIN -1 // 21
#define E1_DIR_PIN -1 // 20
#define E1_ENABLE_PIN -1 // 19
#define E2_STEP_PIN -1 // 21
#define E2_DIR_PIN -1 // 20
#define E2_ENABLE_PIN -1 // 18
#define E2_STEP_PIN -1 // 21
#define E2_DIR_PIN -1 // 20
#define E2_ENABLE_PIN -1 // 18
#define SDPOWER -1
#define SDSS 11
@ -87,5 +87,6 @@
#define HEATER_BED_PIN 4
#define TEMP_BED_PIN 2 // 1,2 or I2C
#define I2C_SCL 16
#define I2C_SDA 17
#define I2C_SCL 16
#define I2C_SDA 17