Skip to content

Commit

Permalink
Check for TinyG aam parameter at connect
Browse files Browse the repository at this point in the history
Sometimes, TinyG changes this on its own (???). A cause for this has not been found; this is a problem hiding workaround, not a fix!
  • Loading branch information
jkuusama committed Nov 14, 2022
1 parent 7d97082 commit 1d826ad
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions LitePlacer/TinyGControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public bool JustConnected()
{
return false;
}
// Checking aam parameter, and if not 1, force it
// TODO: Find out the real problem, don't hide it!
if (MainForm.TinyGBoard.Aam != "1")
{
if (!Write_m("{\"aam\":1}")) // aam mode
{
return false;
}
}
MainForm.SetMotorPower_checkBox(true);
return true;
}
Expand Down Expand Up @@ -271,7 +280,6 @@ public bool Home_m(string axis)
"Homing operation mechanical step failed, CNC issue",
"Homing failed",
MessageBoxButtons.OK);
Cnc.Homing = false;
return false;
}
MainForm.DisplayText("Homing " + axis + " done.");
Expand Down Expand Up @@ -775,7 +783,7 @@ internal class Sr
set
{
_posx = value;
CNC.setCurrX(_posx);
CNC.SetCurrentX(_posx);
CNC.MainForm.ValueUpdater("posx", _posx.ToString("0.000", CultureInfo.InvariantCulture));
}
}
Expand All @@ -787,7 +795,7 @@ internal class Sr
set
{
_posy = value;
CNC.setCurrY(_posy);
CNC.SetCurrentY(_posy);
CNC.MainForm.ValueUpdater("posy", _posy.ToString("0.000", CultureInfo.InvariantCulture));
}
}
Expand All @@ -799,7 +807,7 @@ internal class Sr
set
{
_posz = value;
CNC.setCurrZ(_posz);
CNC.SetCurrentZ(_posz);
CNC.MainForm.ValueUpdater("posz", _posz.ToString("0.000", CultureInfo.InvariantCulture));
}
}
Expand All @@ -811,7 +819,7 @@ internal class Sr
set
{
_posa = value;
CNC.setCurrA(_posa);
CNC.SetCurrentA(_posa);
CNC.MainForm.ValueUpdater("posa", _posa.ToString("0.000", CultureInfo.InvariantCulture));
}
}
Expand Down

0 comments on commit 1d826ad

Please sign in to comment.