Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
535ff4d1
Commit
535ff4d1
authored
13 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Resolved bug on random values for delay in generated CPOSIX code / AVATAR
parent
f2b48452
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
executablecode/Makefile.src
+1
-1
1 addition, 1 deletion
executablecode/Makefile.src
executablecode/src/mytimelib.c
+4
-1
4 additions, 1 deletion
executablecode/src/mytimelib.c
executablecode/src/random.c
+4
-3
4 additions, 3 deletions
executablecode/src/random.c
with
9 additions
and
5 deletions
executablecode/Makefile.src
+
1
−
1
View file @
535ff4d1
SRCS
=
generated_src/main.c generated_src/TestBench.c generated_src/SpeedSensor.c generated_src/RadarSensor.c generated_src/GPSSensor.c generated_src/CarPositionSimulator.c generated_src/EmergencySimulator.c generated_src/Communication.c generated_src/DSRSC_Management.c generated_src/NeighbourhoodTableManagement.c generated_src/CorrectnessChecking.c generated_src/PTC.c generated_src/DrivingPowerReductionStrategy.c generated_src/BCU.c generated_src/DangerAvoidanceStrategy.c generated_src/BrakeManagement.c generated_src/CSCU.c generated_src/ObjectListManagement.c generated_src/PlausibilityCheck.c generated_src/VehiculeDynamicsManagement.c
\ No newline at end of file
SRCS
=
generated_src/main.c generated_src/Block0.c generated_src/Block2.c generated_src/Block1.c
\ No newline at end of file
This diff is collapsed.
Click to expand it.
executablecode/src/mytimelib.c
+
4
−
1
View file @
535ff4d1
...
...
@@ -90,8 +90,11 @@ void waitFor(long minDelay, long maxDelay) {
struct
timespec
tsret
;
int
delay
;
debugMsg
(
"Computing random"
);
debugMsg
(
"Computing random delay"
);
//debugLong("Min delay", minDelay);
//debugLong("Max delay", maxDelay);
delay
=
computeLongRandom
(
minDelay
,
maxDelay
);
debugLong
(
"Random delay="
,
delay
);
...
...
This diff is collapsed.
Click to expand it.
executablecode/src/random.c
+
4
−
3
View file @
535ff4d1
...
...
@@ -23,13 +23,14 @@ long computeLongRandom(long min, long max) {
return
min
;
}
long
rand0
=
(((
long
)(
rand
()))
*
powl
(
2
,
((((
sizeof
(
long
)
-
2
))
*
8
)
-
1
)));
long
rand0
=
(
long
)
rand
();
long
rand1
=
rand0
%
(
max
-
min
);
//debugLong("min=", min);
//debugLong("max=", max);
//debugLong("rand0", rand0);
//debugLong("rand1", rand1);
debugLong
(
"Random long"
,
rand1
+
min
);
//debugLong("rand1", rand1);
//
debugLong("Random long", rand1 + min);
return
rand1
+
min
;
}
...
...
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