removed more arduino bullshit functions

This commit is contained in:
2021-10-03 19:27:50 +02:00
parent 98cf7b89b9
commit 3051ce4a77
3 changed files with 12 additions and 6 deletions

View File

@ -42,6 +42,7 @@
#include "Adafruit_TSL2561_U.h" #include "Adafruit_TSL2561_U.h"
#include <espchrono.h> #include <espchrono.h>
#include <tickchrono.h>
//#define DEBUG_OUTPUT //#define DEBUG_OUTPUT
#ifdef 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 */ /* Wait x ms for ADC to complete */
switch (_tsl2561IntegrationTime) { switch (_tsl2561IntegrationTime) {
case TSL2561_INTEGRATIONTIME_13MS: case TSL2561_INTEGRATIONTIME_13MS:
delay(TSL2561_DELAY_INTTIME_13MS); // KTOWN: Was 14ms espcpputils::delay(TSL2561_DELAY_INTTIME_13MS); // KTOWN: Was 14ms
break; break;
case TSL2561_INTEGRATIONTIME_101MS: case TSL2561_INTEGRATIONTIME_101MS:
delay(TSL2561_DELAY_INTTIME_101MS); // KTOWN: Was 102ms espcpputils::delay(TSL2561_DELAY_INTTIME_101MS); // KTOWN: Was 102ms
break; break;
default: default:
delay(TSL2561_DELAY_INTTIME_402MS); // KTOWN: Was 403ms espcpputils::delay(TSL2561_DELAY_INTTIME_402MS); // KTOWN: Was 403ms
break; break;
} }

View File

@ -24,6 +24,9 @@
#include <Adafruit_Sensor.h> #include <Adafruit_Sensor.h>
#include <Arduino.h> #include <Arduino.h>
#include <Wire.h> #include <Wire.h>
#include <chrono>
using namespace std::chrono_literals;
#define TSL2561_VISIBLE 2 ///< channel 0 - channel 1 #define TSL2561_VISIBLE 2 ///< channel 0 - channel 1
#define TSL2561_INFRARED 1 ///< 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 (65000) ///< # Counts that trigger a change in gain/integration
// Delay for integration times // Delay for integration times
#define TSL2561_DELAY_INTTIME_13MS (15) ///< Wait 15ms for 13ms integration constexpr const auto TSL2561_DELAY_INTTIME_13MS = 15ms; ///< Wait 15ms for 13ms integration
#define TSL2561_DELAY_INTTIME_101MS (120) ///< Wait 120ms for 101ms integration constexpr const auto TSL2561_DELAY_INTTIME_101MS = 120ms; ///< Wait 120ms for 101ms integration
#define TSL2561_DELAY_INTTIME_402MS (450) ///< Wait 450ms for 402ms integration constexpr const auto TSL2561_DELAY_INTTIME_402MS = 450ms; ///< Wait 450ms for 402ms integration
/** TSL2561 I2C Registers */ /** TSL2561 I2C Registers */
enum { enum {

View File

@ -9,6 +9,8 @@ set(sources
set(dependencies set(dependencies
arduino-esp32 arduino-esp32
Adafruit_Sensor Adafruit_Sensor
espchrono
espcpputils
) )
idf_component_register( idf_component_register(