Skip to content

Commit a3320e7

Browse files
committed
stmhal/i2c: Remove use of legacy I2C_NOSTRETCH_DISABLED option.
In the new HAL this is renamed to I2C_NOSTRETCH_DISABLE.
1 parent 2eff9c2 commit a3320e7

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

stmhal/accel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ STATIC void accel_start(void) {
6969
I2CHandle1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
7070
I2CHandle1.Init.DutyCycle = I2C_DUTYCYCLE_16_9;
7171
I2CHandle1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLED;
72-
I2CHandle1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLED;
72+
I2CHandle1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
7373
I2CHandle1.Init.OwnAddress1 = PYB_I2C_MASTER_ADDRESS;
7474
I2CHandle1.Init.OwnAddress2 = 0xfe; // unused
7575
i2c_init(&I2CHandle1);

stmhal/i2c.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
#define MICROPY_HW_I2C_BAUDRATE_MAX 400000
4646
#endif
4747

48-
#if !defined(I2C_NOSTRETCH_DISABLE)
49-
// Assumes that the F7 firmware is newer, so the F4 firmware will eventually
50-
// catchup. I2C_NOSTRETCH_DISABLED was renamed to I2C_NOSTRETCH_DISABLE
51-
// in the F7 so we use the F7 constant and provide a backwards compatabilty
52-
// #define here.
53-
#define I2C_NOSTRETCH_DISABLE I2C_NOSTRETCH_DISABLED
54-
#endif
55-
5648
/// \moduleref pyb
5749
/// \class I2C - a two-wire serial protocol
5850
///
@@ -503,7 +495,6 @@ STATIC mp_obj_t pyb_i2c_init_helper(const pyb_i2c_obj_t *self, mp_uint_t n_args,
503495
init->AddressingMode = I2C_ADDRESSINGMODE_7BIT;
504496
init->DualAddressMode = I2C_DUALADDRESS_DISABLED;
505497
init->GeneralCallMode = args[3].u_bool ? I2C_GENERALCALL_ENABLED : I2C_GENERALCALL_DISABLED;
506-
init->NoStretchMode = I2C_NOSTRETCH_DISABLED;
507498
init->OwnAddress2 = 0; // unused
508499
init->NoStretchMode = I2C_NOSTRETCH_DISABLE;
509500

0 commit comments

Comments
 (0)