From 98cf7b89b9c34ae99714f701aa53eea9c605f145 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Thu, 15 Jul 2021 13:13:45 +0200 Subject: [PATCH] Implement typesafety for addr macros --- Adafruit_TSL2561_U.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Adafruit_TSL2561_U.h b/Adafruit_TSL2561_U.h index f526b37..4437782 100644 --- a/Adafruit_TSL2561_U.h +++ b/Adafruit_TSL2561_U.h @@ -30,9 +30,9 @@ #define TSL2561_FULLSPECTRUM 0 ///< channel 0 // I2C address options -#define TSL2561_ADDR_LOW (0x29) ///< Default address (pin pulled low) -#define TSL2561_ADDR_FLOAT (0x39) ///< Default address (pin left floating) -#define TSL2561_ADDR_HIGH (0x49) ///< Default address (pin pulled high) +constexpr const uint8_t TSL2561_ADDR_LOW = 0x29; ///< Default address (pin pulled low) +constexpr const uint8_t TSL2561_ADDR_FLOAT = 0x39; ///< Default address (pin left floating) +constexpr const uint8_t TSL2561_ADDR_HIGH = 0x49; ///< Default address (pin pulled high) // Lux calculations differ slightly for CS package //#define TSL2561_PACKAGE_CS ///< Chip scale package