1
0
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:
J. Nick Koston
2025-12-30 13:46:48 -10:00
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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);