esp32/machine_i2c: Fix build warnings when I2C is disabled.

Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
This commit is contained in:
IhorNehrutsa 2024-01-30 15:58:22 +02:00 committed by Damien George
parent 802a88c3b1
commit d9944983cb

4
ports/esp32/machine_i2c.c Normal file → Executable file
View File

@ -32,6 +32,8 @@
#include "driver/i2c.h"
#include "hal/i2c_ll.h"
#if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SOFTI2C
#ifndef MICROPY_HW_I2C0_SCL
#define MICROPY_HW_I2C0_SCL (GPIO_NUM_18)
#define MICROPY_HW_I2C0_SDA (GPIO_NUM_19)
@ -210,3 +212,5 @@ MP_DEFINE_CONST_OBJ_TYPE(
protocol, &machine_hw_i2c_p,
locals_dict, &mp_machine_i2c_locals_dict
);
#endif