Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleanup of hold_z code

  • Loading branch information...
commit f0736f77c82b3ae22291c29d8297073bb1696c84 1 parent 69c4187
Adam Mayer authored October 03, 2011
13  v2/src/Motherboard/boards/mb24/Motherboard.cc
@@ -99,11 +99,16 @@ void Motherboard::reset() {
99 99
 	indicateError(0); // turn off blinker
100 100
 
101 101
 	// Init steppers
102  
-	
103 102
 	uint8_t axis_invert = eeprom::getEeprom8(eeprom::AXIS_INVERSION, 0);
104  
-	bool dont_hold_z = (axis_invert & (1<<7)) != 0;
105  
-        if (dont_hold_z)
106  
-                steppers::setHoldZ(true);
  103
+	// Z holding indicates that when the Z axis is not in
  104
+	// motion, the machine should continue to power the stepper
  105
+	// coil to ensure that the Z stage does not shift.
  106
+	// Bit 7 of the AXIS_INVERSION eeprom setting
  107
+	// indicates whether or not to use z holding; 
  108
+	// the bit is active low. (0 means use z holding,
  109
+	// 1 means turn it off.)
  110
+	bool hold_z = (axis_invert & (1<<7)) == 0;
  111
+	steppers::setHoldZ(hold_z);
107 112
 
108 113
 	for (int i = 0; i < STEPPER_COUNT; i++) {
109 114
 		stepper[i].init(i);
12  v2/src/Motherboard/boards/rrmbv12/Motherboard.cc
@@ -88,9 +88,15 @@ void Motherboard::reset() {
88 88
 
89 89
 	// Init steppers
90 90
 	uint8_t axis_invert = eeprom::getEeprom8(eeprom::AXIS_INVERSION, 0);
91  
-	bool dont_hold_z = (axis_invert & (1<<7)) != 0;
92  
-        if (dont_hold_z)
93  
-                steppers::setHoldZ(true);
  91
+	// Z holding indicates that when the Z axis is not in
  92
+	// motion, the machine should continue to power the stepper
  93
+	// coil to ensure that the Z stage does not shift.
  94
+	// Bit 7 of the AXIS_INVERSION eeprom setting
  95
+	// indicates whether or not to use z holding; 
  96
+	// the bit is active low. (0 means use z holding,
  97
+	// 1 means turn it off.)
  98
+	bool hold_z = (axis_invert & (1<<7)) == 0;
  99
+	steppers::setHoldZ(hold_z);
94 100
 
95 101
 	for (int i = 0; i < STEPPER_COUNT; i++) {
96 102
 		stepper[i].init(i);

0 notes on commit f0736f7

Please sign in to comment.
Something went wrong with that request. Please try again.