mirror of
https://github.com/synthetos/g2.git
synced 2026-09-23 21:38:54 +08:00
Removed commented code replaced in the merge
This commit is contained in:
@@ -441,17 +441,8 @@ static void _load_move()
|
||||
return; // exit if the runtime is busy
|
||||
}
|
||||
|
||||
// <<<<<<< HEAD
|
||||
// If there are no moves to load start motor power timeouts
|
||||
if (st_pre.buffer_state != PREP_BUFFER_OWNED_BY_LOADER) {
|
||||
/* =======
|
||||
// ...start motor power timeouts
|
||||
// for (uint8_t motor = MOTOR_1; motor < MOTORS; motor++) {
|
||||
// Motors[motor]->motionStopped();
|
||||
// }
|
||||
// loop unrolled version
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
motor_1.motionStopped(); // ...start motor power timeouts
|
||||
motor_2.motionStopped();
|
||||
#if (MOTORS > 2)
|
||||
@@ -944,15 +935,9 @@ stat_t st_set_su(nvObj_t *nv)
|
||||
if (cm_get_axis_type(nv) == AXIS_TYPE_LINEAR) {
|
||||
nv->value_flt *= INCHES_PER_MM;
|
||||
}
|
||||
// <<<<<<< HEAD
|
||||
}
|
||||
uint8_t m = _motor(nv->index);
|
||||
st_cfg.mot[m].steps_per_unit = nv->value_flt;
|
||||
/* =======
|
||||
}
|
||||
set_flt(nv);
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
st_cfg.mot[m].units_per_step = 1.0/st_cfg.mot[m].steps_per_unit;
|
||||
|
||||
// Scale TR so all the other values make sense
|
||||
@@ -962,53 +947,9 @@ stat_t st_set_su(nvObj_t *nv)
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
// <<<<<<< HEAD
|
||||
// polarity
|
||||
stat_t st_get_po(nvObj_t *nv) { return(get_integer(nv, st_cfg.mot[_motor(nv->index)].polarity)); }
|
||||
stat_t st_set_po(nvObj_t *nv) { return(set_integer(nv, st_cfg.mot[_motor(nv->index)].polarity, 0, 1)); }
|
||||
/* =======
|
||||
stat_t st_set_ep(nvObj_t *nv) // set motor enable polarity
|
||||
{
|
||||
if (nv->value < IO_ACTIVE_LOW) { return (STAT_INPUT_LESS_THAN_MIN_VALUE); }
|
||||
if (nv->value > IO_ACTIVE_HIGH) { return (STAT_INPUT_EXCEEDS_MAX_VALUE); }
|
||||
|
||||
uint8_t motor = _get_motor(nv->index);
|
||||
if (motor > MOTORS) { return STAT_INPUT_VALUE_RANGE_ERROR; };
|
||||
|
||||
Motors[motor]->setEnablePolarity((ioMode)nv->value);
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t st_get_ep(nvObj_t *nv) // get motor enable polarity
|
||||
{
|
||||
if (nv->value < IO_ACTIVE_LOW) { return (STAT_INPUT_LESS_THAN_MIN_VALUE); }
|
||||
if (nv->value > IO_ACTIVE_HIGH) { return (STAT_INPUT_EXCEEDS_MAX_VALUE); }
|
||||
|
||||
uint8_t motor = _get_motor(nv->index);
|
||||
if (motor > MOTORS) { return STAT_INPUT_VALUE_RANGE_ERROR; };
|
||||
|
||||
nv->value = (float)Motors[motor]->getEnablePolarity();
|
||||
nv->valuetype = TYPE_INT;
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
stat_t st_set_pm(nvObj_t *nv) // set motor power mode
|
||||
{
|
||||
if (nv->value < 0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value >= MOTOR_POWER_MODE_MAX_VALUE) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
uint8_t motor = _get_motor(nv->index);
|
||||
if (motor > MOTORS) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return STAT_INPUT_VALUE_RANGE_ERROR;
|
||||
};
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
|
||||
// power management mode
|
||||
stat_t st_get_pm(nvObj_t *nv)
|
||||
@@ -1020,22 +961,10 @@ stat_t st_get_pm(nvObj_t *nv)
|
||||
|
||||
stat_t st_set_pm(nvObj_t *nv)
|
||||
{
|
||||
// <<<<<<< HEAD
|
||||
// Test the value without setting it, then setPowerMode() now
|
||||
// to both set and take effect immediately.
|
||||
ritorno(set_integer(nv, (uint8_t &)cs.null, 0, MOTOR_POWER_MODE_MAX_VALUE ));
|
||||
Motors[_motor(nv->index)]->setPowerMode((stPowerMode)nv->value_int);
|
||||
/* =======
|
||||
uint8_t motor = _get_motor(nv->index);
|
||||
if (motor > MOTORS) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return STAT_INPUT_VALUE_RANGE_ERROR;
|
||||
};
|
||||
|
||||
nv->value = (float)Motors[motor]->getPowerMode();
|
||||
nv->valuetype = TYPE_INT;
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
return (STAT_OK);
|
||||
}
|
||||
|
||||
@@ -1050,30 +979,11 @@ stat_t st_set_pm(nvObj_t *nv)
|
||||
stat_t st_get_pl(nvObj_t *nv) { return(get_float(nv, st_cfg.mot[_motor(nv->index)].power_level)); }
|
||||
stat_t st_set_pl(nvObj_t *nv)
|
||||
{
|
||||
// <<<<<<< HEAD
|
||||
uint8_t m = _motor(nv->index);
|
||||
ritorno(set_float_range(nv, st_cfg.mot[m].power_level, 0.0, 1.0));
|
||||
st_cfg.mot[m].power_level_scaled = (nv->value_flt * POWER_LEVEL_SCALE_FACTOR);
|
||||
st_run.mot[m].power_level_dynamic = (st_cfg.mot[m].power_level_scaled);
|
||||
Motors[m]->setPowerLevel(st_cfg.mot[m].power_level_scaled);
|
||||
/* =======
|
||||
if (nv->value < (float)0.0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_LESS_THAN_MIN_VALUE);
|
||||
}
|
||||
if (nv->value > (float)1.0) {
|
||||
nv->valuetype = TYPE_NULL;
|
||||
return (STAT_INPUT_EXCEEDS_MAX_VALUE);
|
||||
}
|
||||
set_flt(nv); // set power_setting value in the motor config struct (st)
|
||||
|
||||
uint8_t motor = _get_motor(nv->index);
|
||||
st_cfg.mot[motor].power_level_scaled = (nv->value * POWER_LEVEL_SCALE_FACTOR);
|
||||
st_run.mot[motor].power_level_dynamic = (st_cfg.mot[motor].power_level_scaled);
|
||||
Motors[motor]->setPowerLevel(st_cfg.mot[motor].power_level_scaled);
|
||||
|
||||
>>>>>>> refs/heads/edge
|
||||
*/
|
||||
return(STAT_OK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user