Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Monitoring Module
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
DIOT Monitoring Module
Commits
2f248bbf
Commit
2f248bbf
authored
Oct 12, 2021
by
Christos Gentsos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I2C: Fix bug with command 0x00 always returning zero
parent
a79fbf97
Pipeline
#2593
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
i2c_slave.c
common/src/i2c_slave.c
+2
-3
No files found.
common/src/i2c_slave.c
View file @
2f248bbf
...
...
@@ -17,7 +17,7 @@ static struct io_descriptor *io;
static
uint16_t
dev_addr
__xMR
;
static
uint16_t
rx_state
__xMR
=
CMD
;
static
uint8_t
tmp_std_cmd_addr
;
static
uint16_t
std_cmd_addr
__xMR
;
static
uint16_t
std_cmd_addr
__xMR
=
0xFF
;
static
int16_t
cmd_index
__xMR
;
static
int16_t
cmd_len
__xMR
;
static
uint8_t
tmp_ext_cmd_addr
;
...
...
@@ -72,7 +72,6 @@ static void __xMR I2C_rx_complete(const struct i2c_s_async_descriptor *const des
if
(
use_pec
)
pec_checksum
=
crc8_byte
(
pec_checksum
^
std_cmd_addr
);
if
(
std_cmd_addr
==
0xFF
)
{
std_cmd_addr
=
0
;
rx_state
=
EXT_CMD
;
send_ack
(
descr
);
set_cmd
(
descr
,
3
);
...
...
@@ -223,7 +222,7 @@ static void __xMR I2C_tx_pending(const struct i2c_s_async_descriptor *const desc
added_tx_pec
=
1
;
sent_checksum
=
0
;
}
if
(
std_cmd_addr
)
{
if
(
std_cmd_addr
!=
0xFF
)
{
if
((
*
cmds
->
cmds
[
cmd_index
].
data_len
<
0
)
&&
(
!
blk_wrote_len_byte
))
{
cmd_len
=
0
;
tx_tmp
=
-*
cmds
->
cmds
[
cmd_index
].
data_len
;
...
...
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