From 45ac0d7f93e286ca2c3df056e0cc2ef1f5dfe10e Mon Sep 17 00:00:00 2001 From: Yordan Ganev Date: Fri, 19 Mar 2021 18:44:37 +0200 Subject: [PATCH 1/2] [#38] Makes begin() return status Fixes Adafruit_TSL2591::begin(uint8_t) always returning true. --- Adafruit_TSL2591.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Adafruit_TSL2591.cpp b/Adafruit_TSL2591.cpp index f2ee9f6..c19ef5c 100644 --- a/Adafruit_TSL2591.cpp +++ b/Adafruit_TSL2591.cpp @@ -112,11 +112,7 @@ boolean Adafruit_TSL2591::begin(TwoWire *theWire, uint8_t addr) { */ /**************************************************************************/ boolean Adafruit_TSL2591::begin(uint8_t addr) { - - begin(&Wire); - _addr = addr; - - return true; + return begin(&Wire, addr); } /**************************************************************************/ From 2a70a0ef543fc479bb701717ec7c63e9c093acc4 Mon Sep 17 00:00:00 2001 From: Yordan Ganev Date: Fri, 19 Mar 2021 19:02:41 +0200 Subject: [PATCH 2/2] [#38] Fixes code formatting --- Adafruit_TSL2591.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Adafruit_TSL2591.cpp b/Adafruit_TSL2591.cpp index c19ef5c..62ed241 100644 --- a/Adafruit_TSL2591.cpp +++ b/Adafruit_TSL2591.cpp @@ -111,9 +111,7 @@ boolean Adafruit_TSL2591::begin(TwoWire *theWire, uint8_t addr) { @returns True if a TSL2591 is found, false on any failure */ /**************************************************************************/ -boolean Adafruit_TSL2591::begin(uint8_t addr) { - return begin(&Wire, addr); -} +boolean Adafruit_TSL2591::begin(uint8_t addr) { return begin(&Wire, addr); } /**************************************************************************/ /*!