Skip to content
Snippets Groups Projects
Commit cff231d1 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Apply new flag-semantic to syncedStart

parent 38b51af4
Branches
Tags
No related merge requests found
......@@ -345,7 +345,21 @@ classdef Motor < MaskedHandle & dynamicprops
if motor.power == 0
warning('Motor::syncedStart: Synchronized motors starting with power=0.');
end
% If the motor coasts into its stops, the internal tachocount has to be reset
% before each start for it to behave predictable
if motor.brakeMode_ == BrakeMode.Coast
motor.internalReset();
end
if motor.sendOnStart > 0
% If stop-flag is set: call stop() and reset flag
if bitget(motor.sendOnStart, SendOnStart.Stop)
motor.stop();
motor.sendOnStart = bitset(motor.sendOnStart, SendOnStart.Stop, 0);
end
end
% Cache old values to make it possible to reset them on stopSynced
% Note: the existence of 'syncCache' is also used to determine whether motor is
% running synchronized or not, see get.isSynced()
......@@ -413,7 +427,8 @@ classdef Motor < MaskedHandle & dynamicprops
% Retrieve other values from cache and delete it
motor.sendPowerOnSet = motor.syncCache.master_oldSendPowerOnSet;
syncMotor.sendPowerOnSet = motor.syncCache.slave_oldSendPowerOnSet;
%syncMotor.sendPowerOnSet = motor.syncCache.slave_oldSendPowerOnSet;
syncMotor.sendPowerOnSet = motor.syncCache.master_oldSendPowerOnSet;
delete(motor.findprop('syncCache'));
% Synced stopping
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment