Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
826ee2c5
Commit
826ee2c5
authored
Mar 02, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IO Arduino write response wasn't handled
parent
112be641
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
otherio/lib/rt/src/rt_io_m_arduino_uno.c
otherio/lib/rt/src/rt_io_m_arduino_uno.c
+29
-0
No files found.
otherio/lib/rt/src/rt_io_m_arduino_uno.c
View file @
826ee2c5
...
...
@@ -94,6 +94,8 @@ typedef struct {
int
DiPollId
;
int
DiPendingPoll
;
ard_eMsgType
PendingMsgType
;
int
ReceiveWriteRespons
;
int
WriteId
;
int
AiIntervalCnt
;
int
AoIntervalCnt
;
int
Reconnect
;
...
...
@@ -612,6 +614,21 @@ static pwr_tStatus IoCardRead( io_tCtx ctx,
if
(
local
->
Reconnect
)
return
IO__SUCCESS
;
if
(
local
->
ReceiveWriteRespons
)
{
// Receive response status from last write
ard_sMsg
rmsg
;
sts
=
receive
(
local
->
fd
,
local
->
WriteId
,
&
rmsg
,
1
,
op
->
Timeout
,
op
);
if
(
EVEN
(
sts
))
op
->
ErrorCount
++
;
else
{
op
->
Status
=
rmsg
.
data
[
0
];
if
(
EVEN
(
op
->
Status
))
op
->
ErrorCount
++
;
}
local
->
ReceiveWriteRespons
=
0
;
}
if
(
local
->
AiSize
)
{
skip_ai
=
0
;
...
...
@@ -877,6 +894,10 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
add_checksum
(
&
msg
);
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
if
(
sts
>
0
)
{
local
->
ReceiveWriteRespons
=
1
;
local
->
WriteId
=
msg
.
id
;
}
}
else
if
(
local
->
AoSize
&&
!
local
->
DoSize
)
{
...
...
@@ -944,6 +965,10 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
add_checksum
(
&
msg
);
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
if
(
sts
>
0
)
{
local
->
ReceiveWriteRespons
=
1
;
local
->
WriteId
=
msg
.
id
;
}
}
}
else
if
(
local
->
DoSize
&&
!
skip_ao
)
{
...
...
@@ -1035,6 +1060,10 @@ static pwr_tStatus IoCardWrite( io_tCtx ctx,
add_checksum
(
&
msg
);
sts
=
write
(
local
->
fd
,
&
msg
,
msg
.
size
);
if
(
sts
>
0
)
{
local
->
ReceiveWriteRespons
=
1
;
local
->
WriteId
=
msg
.
id
;
}
}
if
(
sts
<
0
)
{
...
...
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