Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
b9b93d03
Commit
b9b93d03
authored
8 years ago
by
Tim Stadtmann
Browse files
Options
Downloads
Patches
Plain Diff
Make pause after sending packets adjustable
... for testing purposes
parent
d9f8d412
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/CommunicationInterface.m
+14
-2
14 additions, 2 deletions
source/CommunicationInterface.m
source/EV3.m
+12
-0
12 additions, 0 deletions
source/EV3.m
with
26 additions
and
2 deletions
source/CommunicationInterface.m
+
14
−
2
View file @
b9b93d03
...
...
@@ -103,6 +103,8 @@ classdef CommunicationInterface < handle
properties
% Debug
debug
;
pauseAfterSend
=
0
;
end
properties
(
SetAccess
=
private
)
...
...
@@ -211,6 +213,14 @@ classdef CommunicationInterface < handle
end
end
function
set
.
pauseAfterSend
(
brick
,
pauseAfterSend
)
if
pauseAfterSend
<
0
error
(
'Give pauseLength invalid.'
);
end
brick
.
pauseAfterSend
=
pauseAfterSend
;
end
function
set
.
debug
(
brick
,
debug
)
% If debug is set in this layer, also set BrickIO.debug in lower layer
brick
.
debug
=
debug
;
...
...
@@ -264,8 +274,10 @@ classdef CommunicationInterface < handle
% behaving 'strange'. Sometimes, commands will be executed only with
% a delay, some commands may even be bypassed.
% (Maybe too many commands screw up the brick's internal command queue?..)
% Temporary workaround: Wait 5ms after each sent packet.
pause
(
0.005
);
% Temporary workaround: Wait pauseAfterSend seconds after each sent packet.
if
brick
.
pauseAfterSend
>
0
pause
(
brick
.
pauseAfterSend
);
end
% Verbose output
if
brick
.
debug
>
0
...
...
This diff is collapsed.
Click to expand it.
source/EV3.m
+
12
−
0
View file @
b9b93d03
...
...
@@ -60,6 +60,9 @@ classdef EV3 < MaskedHandle
% - 2: Low-level-Debug turned on - each packet sent and received is printed to the
% console
debug
;
% Seconds waited after each send
pauseAfterSend
=
0
;
end
properties
(
Dependent
)
% Parameters to be read directly from physical brick
...
...
@@ -406,6 +409,15 @@ classdef EV3 < MaskedHandle
end
end
function
set
.
pauseAfterSend
(
ev3
,
pauseAfterSend
)
if
pauseAfterSend
<
0
error
(
'Give pauseLength invalid.'
);
end
ev3
.
pauseAfterSend
=
pauseAfterSend
;
ev3
.
commInterface
.
pauseAfterSend
=
pauseAfterSend
;
% This does the real job
end
function
setProperties
(
ev3
,
varargin
)
% Set multiple EV3 properties at once using MATLAB's inputParser.
%
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment