forked from adafruit/Adafruit_TSL2561
removed more arduino bullshit functions
This commit is contained in:
@ -42,6 +42,7 @@
|
||||
#include "Adafruit_TSL2561_U.h"
|
||||
|
||||
#include <espchrono.h>
|
||||
#include <tickchrono.h>
|
||||
|
||||
//#define DEBUG_OUTPUT
|
||||
#ifdef DEBUG_OUTPUT
|
||||
@ -360,13 +361,13 @@ std::optional<Adafruit_TSL2561_Unified::Luminosity> Adafruit_TSL2561_Unified::ge
|
||||
/* Wait x ms for ADC to complete */
|
||||
switch (_tsl2561IntegrationTime) {
|
||||
case TSL2561_INTEGRATIONTIME_13MS:
|
||||
delay(TSL2561_DELAY_INTTIME_13MS); // KTOWN: Was 14ms
|
||||
espcpputils::delay(TSL2561_DELAY_INTTIME_13MS); // KTOWN: Was 14ms
|
||||
break;
|
||||
case TSL2561_INTEGRATIONTIME_101MS:
|
||||
delay(TSL2561_DELAY_INTTIME_101MS); // KTOWN: Was 102ms
|
||||
espcpputils::delay(TSL2561_DELAY_INTTIME_101MS); // KTOWN: Was 102ms
|
||||
break;
|
||||
default:
|
||||
delay(TSL2561_DELAY_INTTIME_402MS); // KTOWN: Was 403ms
|
||||
espcpputils::delay(TSL2561_DELAY_INTTIME_402MS); // KTOWN: Was 403ms
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,9 @@
|
||||
#include <Adafruit_Sensor.h>
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
#include <chrono>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define TSL2561_VISIBLE 2 ///< channel 0 - channel 1
|
||||
#define TSL2561_INFRARED 1 ///< channel 1
|
||||
@ -123,9 +126,9 @@ constexpr const uint8_t TSL2561_ADDR_HIGH = 0x49; ///< Default address (pin pul
|
||||
(65000) ///< # Counts that trigger a change in gain/integration
|
||||
|
||||
// Delay for integration times
|
||||
#define TSL2561_DELAY_INTTIME_13MS (15) ///< Wait 15ms for 13ms integration
|
||||
#define TSL2561_DELAY_INTTIME_101MS (120) ///< Wait 120ms for 101ms integration
|
||||
#define TSL2561_DELAY_INTTIME_402MS (450) ///< Wait 450ms for 402ms integration
|
||||
constexpr const auto TSL2561_DELAY_INTTIME_13MS = 15ms; ///< Wait 15ms for 13ms integration
|
||||
constexpr const auto TSL2561_DELAY_INTTIME_101MS = 120ms; ///< Wait 120ms for 101ms integration
|
||||
constexpr const auto TSL2561_DELAY_INTTIME_402MS = 450ms; ///< Wait 450ms for 402ms integration
|
||||
|
||||
/** TSL2561 I2C Registers */
|
||||
enum {
|
||||
|
@ -9,6 +9,8 @@ set(sources
|
||||
set(dependencies
|
||||
arduino-esp32
|
||||
Adafruit_Sensor
|
||||
espchrono
|
||||
espcpputils
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
|
Reference in New Issue
Block a user