Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DIOT Monitoring Module
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Monitor
Incidents
Service Desk
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
Projects
DIOT Monitoring Module
Commits
98399c6f
Commit
98399c6f
authored
4 years ago
by
Christos Gentsos
Browse files
Options
Downloads
Patches
Plain Diff
Mitig: do TMR check before sending PEC checksum
parent
86b4e585
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/src/i2c_slave.c
+5
-2
5 additions, 2 deletions
common/src/i2c_slave.c
with
5 additions
and
2 deletions
common/src/i2c_slave.c
+
5
−
2
View file @
98399c6f
...
...
@@ -30,6 +30,7 @@ static cmd_space_t *ext_cmds;
uint16_t
use_pec
__xMR
=
0
;
static
uint16_t
pec_checksum
__xMR
;
static
uint8_t
tmp_pec_checksum
;
static
uint8_t
checksum_from_m
;
static
uint16_t
added_tx_pec
__xMR
=
0
;
static
uint16_t
sent_checksum
__xMR
=
0
;
...
...
@@ -229,7 +230,8 @@ static void __xMR I2C_tx_pending(const struct i2c_s_async_descriptor *const desc
set_cmd
(
descr
,
3
);
++
cmd_len
;
}
else
if
(
use_pec
&&
!
sent_checksum
)
{
io_write
(
io
,
(
uint8_t
*
)
&
pec_checksum
,
1
);
tmp_pec_checksum
=
pec_checksum
;
io_write
(
io
,
(
uint8_t
*
)
&
tmp_pec_checksum
,
1
);
set_cmd
(
descr
,
3
);
sent_checksum
=
1
;
}
else
{
...
...
@@ -254,7 +256,8 @@ static void __xMR I2C_tx_pending(const struct i2c_s_async_descriptor *const desc
set_cmd
(
descr
,
3
);
++
cmd_len
;
}
else
if
(
use_pec
&&
!
sent_checksum
)
{
io_write
(
io
,
(
uint8_t
*
)
&
pec_checksum
,
1
);
tmp_pec_checksum
=
pec_checksum
;
io_write
(
io
,
(
uint8_t
*
)
&
tmp_pec_checksum
,
1
);
set_cmd
(
descr
,
3
);
sent_checksum
=
1
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment