mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 08:41:59 +00:00
Merge branch 'dump_summary' into integration
This commit is contained in:
@@ -11,13 +11,13 @@ void log_pin(const char *tag, const __FlashStringHelper *prefix, GPIOPin *pin) {
|
||||
char prefix_buf[LOG_PIN_PREFIX_MAX_LEN];
|
||||
strncpy_P(prefix_buf, reinterpret_cast<const char *>(prefix), sizeof(prefix_buf) - 1);
|
||||
prefix_buf[sizeof(prefix_buf) - 1] = '\0';
|
||||
log_pin_with_prefix_(tag, prefix_buf, pin);
|
||||
log_pin_with_prefix(tag, prefix_buf, pin);
|
||||
}
|
||||
#else
|
||||
void log_pin(const char *tag, const char *prefix, GPIOPin *pin) {
|
||||
if (pin == nullptr)
|
||||
return;
|
||||
log_pin_with_prefix_(tag, prefix, pin);
|
||||
log_pin_with_prefix(tag, prefix, pin);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ inline size_t GPIOPin::dump_summary(char *buffer, size_t len) const {
|
||||
inline std::string GPIOPin::dump_summary() const { return {}; }
|
||||
|
||||
// Inline helper for log_pin - allows compiler to inline into log_pin in gpio.cpp
|
||||
inline void log_pin_with_prefix_(const char *tag, const char *prefix, GPIOPin *pin) {
|
||||
inline void log_pin_with_prefix(const char *tag, const char *prefix, GPIOPin *pin) {
|
||||
char buffer[GPIO_SUMMARY_MAX_LEN];
|
||||
size_t len = pin->dump_summary(buffer, sizeof(buffer));
|
||||
len = std::min(len, sizeof(buffer) - 1);
|
||||
|
||||
Reference in New Issue
Block a user