Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenGEODE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
OpenGEODE
Commits
5679e9a4
Commit
5679e9a4
authored
Dec 30, 2014
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add callback registration for timer SET/RESET
parent
2173f09b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
opengeode/AdaGenerator.py
opengeode/AdaGenerator.py
+38
-6
No files found.
opengeode/AdaGenerator.py
View file @
5679e9a4
...
...
@@ -418,15 +418,47 @@ package {process_name} is'''.format(process_name=process_name,
# for the .ads file, generate the declaration of timers set/reset functions
for
timer
in
process
.
timers
:
ads_template
.
append
(
u'-- Timer {} SET and RESET functions'
.
format
(
timer
))
ads_template
.
append
(
u'procedure SET_{}(val: access asn1SccT_UInt32);'
ads_template
.
append
(
u'-- Timer {} SET and RESET functions'
.
format
(
timer
))
if
simu
:
# Declare callback registration for the SET and RESET functions
ads_template
.
append
(
u'type SET_{}_T is access procedure'
'(value: access asn1SccT_UInt32);'
.
format
(
timer
))
ads_template
.
append
(
u'type RESET_{}_T is access procedure;'
.
format
(
timer
))
for
each
in
(
''
,
'RE'
):
ads_template
.
append
(
'pragma Convention(Convention => C,'
' Entity => {re}SET_{t}_T);'
.
format
(
re
=
each
,
t
=
timer
))
ads_template
.
append
(
'{re}SET_{t} : {re}SET_{t}_T;'
.
format
(
re
=
each
,
t
=
timer
))
ads_template
.
append
(
'procedure Register_{re}SET_{t}'
'(Callback: {re}SET_{t}_T);'
.
format
(
re
=
each
,
t
=
timer
))
ads_template
.
append
(
'pragma Export(C, Register_{re}SET_{t},'
' "register_{re}SET_{t}");'
.
format
(
re
=
each
,
t
=
timer
))
# Code for the SET/RESET timer callback registration
for
each
in
(
''
,
'RE'
):
taste_template
.
append
(
'procedure Register_{re}SET_{t}'
'(Callback:{re}SET_{t}_T) is'
.
format
(
re
=
each
,
t
=
timer
))
taste_template
.
append
(
'begin'
)
taste_template
.
append
(
'{re}SET_{t} := Callback;'
.
format
(
re
=
each
,
t
=
timer
))
taste_template
.
append
(
'end Register_{re}SET_{t};'
.
format
(
re
=
each
,
t
=
timer
))
taste_template
.
append
(
''
)
else
:
ads_template
.
append
(
u'procedure SET_{}(val: access asn1SccT_UInt32);'
.
format
(
timer
))
ads_template
.
append
(
ads_template
.
append
(
u'pragma import(C, SET_{timer}, "{proc}_RI_set_{timer}");'
.
format
(
timer
=
timer
,
proc
=
process_name
))
ads_template
.
append
(
u'procedure RESET_{};'
.
format
(
timer
))
ads_template
.
append
(
ads_template
.
append
(
u'procedure RESET_{};'
.
format
(
timer
))
ads_template
.
append
(
u'pragma import(C, RESET_{timer}, "{proc}_RI_reset_{timer}");'
.
format
(
timer
=
timer
,
proc
=
process_name
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment