Skip to content

Commit 6775574

Browse files
authored
fix(i2c): guard I2C_NUM_1 usage for single-port targets (ESP32-C3) (#568)
1 parent 242d690 commit 6775574

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/i2c/include/i2c_format_helpers.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ template <> struct fmt::formatter<i2c_port_t> {
1818
switch (p) {
1919
case I2C_NUM_0:
2020
return fmt::format_to(ctx.out(), "I2C_NUM_0");
21-
case I2C_NUM_1:
22-
return fmt::format_to(ctx.out(), "I2C_NUM_1");
21+
#ifdef I2C_NUM_1
22+
case I2C_NUM_1:
23+
return fmt::format_to(ctx.out(), "I2C_NUM_1");
24+
#endif
2325
default:
2426
return fmt::format_to(ctx.out(), "Unknown");
2527
}

0 commit comments

Comments
 (0)