fix home status not being saved
This commit is contained in:
@@ -218,13 +218,20 @@ async function jogMotor(motor, delta) {
|
|||||||
|
|
||||||
async function zeroMotor(motor) {
|
async function zeroMotor(motor) {
|
||||||
const cmd = motor === 'ALL' ? 'HOMEALL' : `HOME${motor}`;
|
const cmd = motor === 'ALL' ? 'HOMEALL' : `HOME${motor}`;
|
||||||
|
|
||||||
|
if (motor === 'ALL') {
|
||||||
|
localStorage.setItem('wiji_homed', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
if (BLE.isConnected()) {
|
if (BLE.isConnected()) {
|
||||||
await BLE.write(cmd).catch(e => UI.log(e.message, 'error'));
|
await BLE.write(cmd).catch(e => UI.log(e.message, 'error'));
|
||||||
|
|
||||||
|
const warningEl = document.getElementById('home-warning');
|
||||||
|
if (warningEl) warningEl.style.display = localStorage.getItem('wiji_homed') === 'true' ? 'none' : 'block';
|
||||||
} else {
|
} else {
|
||||||
if (motor === 'ALL') {
|
if (motor === 'ALL') {
|
||||||
steps1 = IK.ARM.HOME_STEPS.m1;
|
steps1 = IK.ARM.HOME_STEPS.m1;
|
||||||
steps2 = IK.ARM.HOME_STEPS.m2;
|
steps2 = IK.ARM.HOME_STEPS.m2;
|
||||||
localStorage.setItem('wiji_homed', 'true');
|
|
||||||
} else if (motor === 1) {
|
} else if (motor === 1) {
|
||||||
steps1 = IK.ARM.HOME_STEPS.m1;
|
steps1 = IK.ARM.HOME_STEPS.m1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user