M82 changed so that it reports steps/mm when given no arguments.
This commit is contained in:
parent
c6021aba5f
commit
91efcc4e48
4 changed files with 30 additions and 2 deletions
22
GCodes.cpp
22
GCodes.cpp
|
@ -1130,6 +1130,7 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
bool result = true;
|
||||
bool error = false;
|
||||
bool resend = false;
|
||||
bool seen;
|
||||
char reply[STRING_LENGTH];
|
||||
|
||||
reply[0] = 0;
|
||||
|
@ -1292,10 +1293,18 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
case 85: // Set inactive time
|
||||
break;
|
||||
|
||||
case 92: // Set steps/mm for some axes
|
||||
case 92: // Set/report steps/mm for some axes
|
||||
seen = false;
|
||||
for(int8_t drive = 0; drive < DRIVES; drive++)
|
||||
if(gb->Seen(gCodeLetters[drive]))
|
||||
{
|
||||
platform->SetDriveStepsPerUnit(drive, gb->GetFValue());
|
||||
seen = true;
|
||||
}
|
||||
if(!seen)
|
||||
snprintf(reply, STRING_LENGTH, "Steps/mm: X: %d, Y: %d, Z: %d, E: %d",
|
||||
(int)platform->DriveStepsPerUnit(X_AXIS), (int)platform->DriveStepsPerUnit(Y_AXIS),
|
||||
(int)platform->DriveStepsPerUnit(Z_AXIS), (int)platform->DriveStepsPerUnit(AXES)); // FIXME - needs to do multiple extruders
|
||||
break;
|
||||
|
||||
case 104: // Depricated
|
||||
|
@ -1550,6 +1559,17 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
|||
reprap.GetMove()->SetIdentityTransform();
|
||||
break;
|
||||
|
||||
case 876: // TEMPORARY - this will go away...
|
||||
if(gb->Seen('P'))
|
||||
{
|
||||
iValue = gb->GetIValue();
|
||||
if(iValue != 1)
|
||||
platform->SetHeatOn(0);
|
||||
else
|
||||
platform->SetHeatOn(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 906: // Set Motor currents
|
||||
for(uint8_t i = 0; i < DRIVES; i++)
|
||||
{
|
||||
|
|
|
@ -131,6 +131,7 @@ void Platform::Init()
|
|||
standbyTemperatures = STANDBY_TEMPERATURES;
|
||||
activeTemperatures = ACTIVE_TEMPERATURES;
|
||||
coolingFanPin = COOLING_FAN_PIN;
|
||||
turnHeatOn = HEAT_ON;
|
||||
|
||||
webDir = WEB_DIR;
|
||||
gcodeDir = GCODE_DIR;
|
||||
|
@ -333,7 +334,7 @@ void Platform::SetHeater(int8_t heater, const float& power)
|
|||
return;
|
||||
|
||||
byte p = (byte)(255.0*fmin(1.0, fmax(0.0, power)));
|
||||
if(HEAT_ON == 0)
|
||||
if(turnHeatOn == 0)
|
||||
p = 255 - p;
|
||||
if(heater == 0)
|
||||
analogWrite(heatOnPins[heater], p);
|
||||
|
|
|
@ -491,6 +491,7 @@ class Platform
|
|||
bool UsePID(int8_t heater);
|
||||
float HeatSampleTime();
|
||||
void CoolingFan(float speed);
|
||||
void SetHeatOn(int8_t ho); //TEMPORARY - this will go away...
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
protected:
|
||||
|
@ -569,6 +570,7 @@ class Platform
|
|||
float standbyTemperatures[HEATERS];
|
||||
float activeTemperatures[HEATERS];
|
||||
int8_t coolingFanPin;
|
||||
int8_t turnHeatOn;
|
||||
|
||||
// Serial/USB
|
||||
|
||||
|
@ -892,6 +894,11 @@ inline void Platform::CoolingFan(float speed)
|
|||
analogWrite(coolingFanPin, (uint8_t)(speed*255.0));
|
||||
}
|
||||
|
||||
inline void Platform::SetHeatOn(int8_t ho)
|
||||
{
|
||||
turnHeatOn = ho;
|
||||
}
|
||||
|
||||
|
||||
//*********************************************************************************************************
|
||||
|
||||
|
|
Binary file not shown.
Reference in a new issue