summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhorNehrutsa <Ihor.Nehrutsa@gmail.com>2024-01-30 15:58:22 +0200
committerDamien George <damien@micropython.org>2024-02-20 16:38:49 +1100
commitd9944983cbc2994a36c47b15595a76a01bed7ecf (patch)
tree34ead1f4213275bde12af8782140b4dcbc9fd643
parent802a88c3b1599777d53cadb0e4439348fe298a8e (diff)
esp32/machine_i2c: Fix build warnings when I2C is disabled.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
-rwxr-xr-x[-rw-r--r--]ports/esp32/machine_i2c.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp32/machine_i2c.c b/ports/esp32/machine_i2c.c
index eefdeaaf9..f4cfa5816 100644..100755
--- a/ports/esp32/machine_i2c.c
+++ b/ports/esp32/machine_i2c.c
@@ -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