[esp32, debug] Add `cpu_frequency` config option and debug sensor (#8542)

This commit is contained in:
Clyde Stubbs authored and GitHub committed 2025-05-01 03:28:07 -05:00
1 parent da9c755f67
commit e215fafebe
10 files changed
+206 -267

No files matched your search

@@ -36,6 +36,9 @@ class DebugComponent : public PollingComponent {
#ifdef USE_ESP32
void set_psram_sensor(sensor::Sensor *psram_sensor) { this->psram_sensor_ = psram_sensor; }
#endif // USE_ESP32
void set_cpu_frequency_sensor(sensor::Sensor *cpu_frequency_sensor) {
this->cpu_frequency_sensor_ = cpu_frequency_sensor;
}
#endif // USE_SENSOR
protected:
uint32_t free_heap_{};
@@ -53,6 +56,7 @@ class DebugComponent : public PollingComponent {
#ifdef USE_ESP32
sensor::Sensor *psram_sensor_{nullptr};
#endif // USE_ESP32
sensor::Sensor *cpu_frequency_sensor_{nullptr};
#endif // USE_SENSOR
#ifdef USE_ESP32
@@ -75,6 +79,7 @@ class DebugComponent : public PollingComponent {
#endif // USE_TEXT_SENSOR
std::string get_reset_reason_();
std::string get_wakeup_cause_();
uint32_t get_free_heap_();
void get_device_info_(std::string &device_info);
void update_platform_();