From 6bd414e288b497527d88793570258df79d251239 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sat, 10 Oct 2020 11:45:13 -0700 Subject: [PATCH] Use uint8_T for I2C_ADDRESS to avoid warning in RigidBot example Marlin/src/feature/dac/dac_mcp4728.cpp: In function 'void mcp4728_init()': Marlin/src/feature/dac/dac_mcp4728.cpp:46:61: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: Wire.requestFrom(I2C_ADDRESS(DAC_DEV_ADDRESS), uint8_t(24)); ^ In file included from Marlin/src/feature/dac/dac_mcp4728.h:30:0, from Marlin/src/feature/dac/dac_mcp4728.cpp:37: /home/jassmith/.platformio/packages/framework-arduino-avr/libraries/Wire/src/Wire.h:64:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int) uint8_t requestFrom(int, int); ^ /home/jassmith/.platformio/packages/framework-arduino-avr/libraries/Wire/src/Wire.h:61:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t) uint8_t requestFrom(uint8_t, uint8_t); ^ --- Marlin/src/HAL/HAL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 8b6a978d2103..5eca2f7eacfe 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -34,7 +34,7 @@ #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) #ifndef I2C_ADDRESS - #define I2C_ADDRESS(A) (A) + #define I2C_ADDRESS(A) uint8_t(A) #endif // Needed for AVR sprintf_P PROGMEM extension