From 4f0f1be1d2d568ee4c6eda311d0a40927b0bc29d Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 27 Jun 2023 21:39:41 +0200 Subject: [PATCH] boards: Fix I2C Arduino mapping The correct macro name is `ARDUINO_I2C_UNO` for Arduino UNO compatible I2C bus location, or `ARDUINO_I2C_NANO` for Arduino Nano compatible I2C bus location. --- boards/common/arduino-atmega/include/arduino_iomap.h | 6 +++++- boards/common/arduino-due/include/arduino_iomap.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/boards/common/arduino-atmega/include/arduino_iomap.h b/boards/common/arduino-atmega/include/arduino_iomap.h index 74eec32453..e7b143357d 100644 --- a/boards/common/arduino-atmega/include/arduino_iomap.h +++ b/boards/common/arduino-atmega/include/arduino_iomap.h @@ -63,7 +63,11 @@ extern "C" { /** * @brief The only hardware I2C on ATmegas */ -#define ARDUINO_I2C0 I2C_DEV(0) +#ifndef BOARD_ARDUINO_NANO +#define ARDUINO_I2C_UNO I2C_DEV(0) +#else +#define ARDUINO_I2C_NANO I2C_DEV(0) +#endif /** @} */ /** diff --git a/boards/common/arduino-due/include/arduino_iomap.h b/boards/common/arduino-due/include/arduino_iomap.h index ac728680ba..0c14f6b96a 100644 --- a/boards/common/arduino-due/include/arduino_iomap.h +++ b/boards/common/arduino-due/include/arduino_iomap.h @@ -56,7 +56,7 @@ extern "C" { /** * @brief The only configured I2C */ -#define ARDUINO_I2C0 I2C_DEV(0) +#define ARDUINO_I2C_UNO I2C_DEV(0) /** @} */ /**