Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e81a5353
Commit
e81a5353
authored
Nov 13, 2016
by
Radomir Dopieralski
Committed by
Damien George
Nov 17, 2016
Browse files
extmod/machine_i2c: Release SDA on bus error
parent
9a82b67f
Changes
1
Hide whitespace changes
Inline
Side-by-side
extmod/machine_i2c.c
View file @
e81a5353
...
...
@@ -117,6 +117,7 @@ STATIC int mp_hal_i2c_write_byte(machine_i2c_obj_t *self, uint8_t val) {
}
mp_hal_i2c_delay
(
self
);
if
(
!
mp_hal_i2c_scl_release
(
self
))
{
mp_hal_i2c_sda_release
(
self
);
return
0
;
// failure
}
mp_hal_i2c_scl_low
(
self
);
...
...
@@ -157,6 +158,7 @@ STATIC int mp_hal_i2c_read_byte(machine_i2c_obj_t *self, uint8_t *val, int nack)
}
mp_hal_i2c_delay
(
self
);
if
(
!
mp_hal_i2c_scl_release
(
self
))
{
mp_hal_i2c_sda_release
(
self
);
return
0
;
// failure
}
mp_hal_i2c_scl_low
(
self
);
...
...
Write
Preview
Supports
Markdown
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