mirror of
https://github.com/esphome/esphome.git
synced 2025-01-02 18:27:55 +01:00
Fix ADC VCC
Fixes https://github.com/esphome/issues/issues/289 Was a linker problem, the macro needs to be defined in global C++ scope (no namespace, not in extern "C" block)
This commit is contained in:
parent
66cbfca99c
commit
9dd9e523ed
@ -1,6 +1,10 @@
|
|||||||
#include "esphome/components/adc/adc_sensor.h"
|
#include "esphome/components/adc/adc_sensor.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
|
#ifdef USE_ADC_SENSOR_VCC
|
||||||
|
ADC_MODE(ADC_VCC)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace adc {
|
namespace adc {
|
||||||
|
|
||||||
|
@ -2,16 +2,13 @@
|
|||||||
|
|
||||||
#include "esphome/core/component.h"
|
#include "esphome/core/component.h"
|
||||||
#include "esphome/core/esphal.h"
|
#include "esphome/core/esphal.h"
|
||||||
|
#include "esphome/core/defines.h"
|
||||||
#include "esphome/components/sensor/sensor.h"
|
#include "esphome/components/sensor/sensor.h"
|
||||||
#include "esphome/components/voltage_sampler/voltage_sampler.h"
|
#include "esphome/components/voltage_sampler/voltage_sampler.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace adc {
|
namespace adc {
|
||||||
|
|
||||||
#ifdef USE_ADC_SENSOR_VCC
|
|
||||||
ADC_MODE(ADC_VCC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
|
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
|
||||||
public:
|
public:
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
|
Loading…
Reference in New Issue
Block a user