Skip to content

Commit e5a4dc2

Browse files
committed
whb04b: Don't change from auto to manual when jogging
Changing mode from auto to manual would require the program to stop and just gives unneccesary warnings when trying it anyway
1 parent 7937593 commit e5a4dc2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • src/hal/user_comps/xhc-whb04b-6

src/hal/user_comps/xhc-whb04b-6/hal.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,9 @@ void Hal::setJogCounts(const HandWheelCounters& counters)
13241324
*memory->out.axisAJogCounts = counters.counts(HandWheelCounters::CounterNameToIndex::AXIS_A);
13251325
*memory->out.axisBJogCounts = counters.counts(HandWheelCounters::CounterNameToIndex::AXIS_B);
13261326
*memory->out.axisCJogCounts = counters.counts(HandWheelCounters::CounterNameToIndex::AXIS_C);
1327-
requestManualMode(false);
1328-
requestTeleopMode(false);
1327+
1328+
requestManualMode(false);
1329+
requestTeleopMode(false);
13291330
}
13301331
// ----------------------------------------------------------------------
13311332
void Hal::setFunction(bool enabled)
@@ -1340,6 +1341,11 @@ bool Hal::requestAutoMode(bool isRisingEdge)
13401341
// ----------------------------------------------------------------------
13411342
bool Hal::requestManualMode(bool isRisingEdge)
13421343
{
1344+
if(isRisingEdge && *memory->in.isModeAuto)
1345+
{
1346+
//Don't try to change from auto to manual
1347+
return false;
1348+
}
13431349
return requestMode(isRisingEdge, memory->out.doModeManual, memory->in.isModeManual);
13441350
}
13451351
// ----------------------------------------------------------------------

0 commit comments

Comments
 (0)