ESPHome
2026.5.0b1
Loading...
Searching...
No Matches
esphome
core
gpio.cpp
Go to the documentation of this file.
1
#include "
esphome/core/gpio.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome
{
5
6
#ifdef USE_ESP8266
7
void
log_pin
(
const
char
*
tag
,
const
__FlashStringHelper *prefix,
GPIOPin
*pin) {
8
if
(pin ==
nullptr
)
9
return
;
10
static
constexpr
size_t
LOG_PIN_PREFIX_MAX_LEN = 32;
11
char
prefix_buf[LOG_PIN_PREFIX_MAX_LEN];
12
strncpy_P(prefix_buf,
reinterpret_cast<
const
char
*
>
(prefix),
sizeof
(prefix_buf) - 1);
13
prefix_buf[
sizeof
(prefix_buf) - 1] =
'\0'
;
14
log_pin_with_prefix
(
tag
, prefix_buf, pin);
15
}
16
#else
17
void
log_pin
(
const
char
*
tag
,
const
char
*prefix,
GPIOPin
*pin) {
18
if
(pin ==
nullptr
)
19
return
;
20
log_pin_with_prefix
(
tag
, prefix, pin);
21
}
22
#endif
23
24
}
// namespace esphome
esphome::GPIOPin
Definition
gpio.h:59
gpio.h
log.h
esphome
Definition
a01nyub.cpp:7
esphome::tag
const char * tag
Definition
log.h:74
esphome::log_pin_with_prefix
void log_pin_with_prefix(const char *tag, const char *prefix, GPIOPin *pin)
Definition
gpio.h:148
esphome::log_pin
void log_pin(const char *tag, const __FlashStringHelper *prefix, GPIOPin *pin)
Definition
gpio.cpp:7
Generated by
1.12.0