mirror of
https://github.com/esphome/esphome.git
synced 2026-06-02 11:08:06 +08:00
[pulse_counter] Fix build failure when use_pcnt is false (#14111)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
#if defined(USE_ESP32)
|
#if defined(USE_ESP32)
|
||||||
#include <soc/soc_caps.h>
|
#include <soc/soc_caps.h>
|
||||||
#ifdef SOC_PCNT_SUPPORTED
|
#if defined(SOC_PCNT_SUPPORTED) && __has_include(<driver/pulse_cnt.h>)
|
||||||
#include <driver/pulse_cnt.h>
|
#include <driver/pulse_cnt.h>
|
||||||
#define HAS_PCNT
|
#define HAS_PCNT
|
||||||
#endif // SOC_PCNT_SUPPORTED
|
#endif // defined(SOC_PCNT_SUPPORTED) && __has_include(<driver/pulse_cnt.h>)
|
||||||
#endif // USE_ESP32
|
#endif // USE_ESP32
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
sensor:
|
||||||
|
- platform: pulse_counter
|
||||||
|
name: Pulse Counter
|
||||||
|
pin: 4
|
||||||
|
use_pcnt: false
|
||||||
|
count_mode:
|
||||||
|
rising_edge: INCREMENT
|
||||||
|
falling_edge: DECREMENT
|
||||||
|
internal_filter: 13us
|
||||||
|
update_interval: 15s
|
||||||
Reference in New Issue
Block a user