Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
9a88a7d7
Commit
9a88a7d7
authored
Sep 19, 2019
by
Jerome Hugues
Committed by
Thanassis Tsiodras
Oct 14, 2019
Browse files
* Generate a value of 0 for __PO_HI_NB_PORTS if the process has no
local ports For openaadl/ocarina#236
parent
71e29209
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
View file @
9a88a7d7
...
...
@@ -1300,11 +1300,25 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Value
=>
Nb_Entities_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Total_Ports_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
-- If there are ports in the local process, we generate a
-- macro indicating the total number of ports in the
-- application, otherwise we generate a value of 0 to avoid
-- dragging the whole transport logic. This may happen in
-- corner cases when using external API for communication.
if
Nb_Ports_In_Process
>
0
then
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Total_Ports_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
else
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Make_Literal
(
New_Int_Value
(
0
,
1
,
10
)));
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
end
if
;
if
not
Is_Empty
(
Global_Port_List
)
then
if
not
Invalid_Global_Port_Added
then
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment