Skip to content

Commit

Permalink
Merge branch 'n7s-tmcc#453-fix-ads-stub-generation' into 'master'
Browse files Browse the repository at this point in the history
TMCC#453 Fixed timer ads stub generation

See merge request taste/opengeode!17
  • Loading branch information
maxime-esa committed Apr 18, 2024
2 parents bf22cb1 + 1be85cb commit 02611d1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions opengeode/AdaGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,16 +934,20 @@ def case_state(state):
ads_template.append(
f'procedure RESET_{timer} (Dest_PID : {ASN1SCC}PID := {ASN1SCC}Env) '
f'renames {process.name}_RI.Reset_{timer};')
ri_stub_ads.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32; Dest_PID : {ASN1SCC}PID := {ASN1SCC}Env);')
ri_stub_adb.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32; Dest_PID : {ASN1SCC}PID := {ASN1SCC}Env) is null;')
ri_stub_ads.append(f'procedure RESET_{timer} (Dest_PID : {ASN1SCC}PID := {ASN1SCC}Env);')
ri_stub_adb.append(f'procedure RESET_{timer} (Dest_PID : {ASN1SCC}PID := {ASN1SCC}Env) is null;')
else:
ads_template.append(
f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32) '
f'renames {process.name}_RI.Set_{timer};')
ads_template.append(
f'procedure RESET_{timer} renames {process.name}_RI.Reset_{timer};')
ri_stub_ads.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32);')
ri_stub_adb.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32) is null;')
ri_stub_ads.append(f'procedure RESET_{timer};')
ri_stub_adb.append(f'procedure RESET_{timer} is null;')
ri_stub_ads.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32);')
ri_stub_adb.append(f'procedure SET_{timer} (Val : in out {ASN1SCC}T_UInt32) is null;')
ri_stub_ads.append(f'procedure RESET_{timer};')
ri_stub_adb.append(f'procedure RESET_{timer} is null;')
else:
# Generic functions get the SET and RESET from template
pass
Expand Down

0 comments on commit 02611d1

Please sign in to comment.