Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
a3320e78
Commit
a3320e78
authored
Nov 22, 2016
by
Damien George
Browse files
stmhal/i2c: Remove use of legacy I2C_NOSTRETCH_DISABLED option.
In the new HAL this is renamed to I2C_NOSTRETCH_DISABLE.
parent
2eff9c29
Changes
2
Hide whitespace changes
Inline
Side-by-side
stmhal/accel.c
View file @
a3320e78
...
...
@@ -69,7 +69,7 @@ STATIC void accel_start(void) {
I2CHandle1
.
Init
.
DualAddressMode
=
I2C_DUALADDRESS_DISABLED
;
I2CHandle1
.
Init
.
DutyCycle
=
I2C_DUTYCYCLE_16_9
;
I2CHandle1
.
Init
.
GeneralCallMode
=
I2C_GENERALCALL_DISABLED
;
I2CHandle1
.
Init
.
NoStretchMode
=
I2C_NOSTRETCH_DISABLE
D
;
I2CHandle1
.
Init
.
NoStretchMode
=
I2C_NOSTRETCH_DISABLE
;
I2CHandle1
.
Init
.
OwnAddress1
=
PYB_I2C_MASTER_ADDRESS
;
I2CHandle1
.
Init
.
OwnAddress2
=
0xfe
;
// unused
i2c_init
(
&
I2CHandle1
);
...
...
stmhal/i2c.c
View file @
a3320e78
...
...
@@ -45,14 +45,6 @@
#define MICROPY_HW_I2C_BAUDRATE_MAX 400000
#endif
#if !defined(I2C_NOSTRETCH_DISABLE)
// Assumes that the F7 firmware is newer, so the F4 firmware will eventually
// catchup. I2C_NOSTRETCH_DISABLED was renamed to I2C_NOSTRETCH_DISABLE
// in the F7 so we use the F7 constant and provide a backwards compatabilty
// #define here.
#define I2C_NOSTRETCH_DISABLE I2C_NOSTRETCH_DISABLED
#endif
/// \moduleref pyb
/// \class I2C - a two-wire serial protocol
///
...
...
@@ -503,7 +495,6 @@ STATIC mp_obj_t pyb_i2c_init_helper(const pyb_i2c_obj_t *self, mp_uint_t n_args,
init
->
AddressingMode
=
I2C_ADDRESSINGMODE_7BIT
;
init
->
DualAddressMode
=
I2C_DUALADDRESS_DISABLED
;
init
->
GeneralCallMode
=
args
[
3
].
u_bool
?
I2C_GENERALCALL_ENABLED
:
I2C_GENERALCALL_DISABLED
;
init
->
NoStretchMode
=
I2C_NOSTRETCH_DISABLED
;
init
->
OwnAddress2
=
0
;
// unused
init
->
NoStretchMode
=
I2C_NOSTRETCH_DISABLE
;
...
...
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