8 static const char *
const TAG =
"debug";
16 ESP_LOGD(TAG,
"LibreTiny Version: %s", lt_get_version());
17 ESP_LOGD(TAG,
"Chip: %s (%04x) @ %u MHz", lt_cpu_get_model_name(), lt_cpu_get_model(), lt_cpu_get_freq_mhz());
18 ESP_LOGD(TAG,
"Chip ID: 0x%06X", lt_cpu_get_mac_id());
19 ESP_LOGD(TAG,
"Board: %s", lt_get_board_code());
20 ESP_LOGD(TAG,
"Flash: %u KiB / RAM: %u KiB", lt_flash_get_size() / 1024, lt_ram_get_size() / 1024);
21 ESP_LOGD(TAG,
"Reset Reason: %s", reset_reason.c_str());
23 device_info +=
"|Version: ";
24 device_info += LT_BANNER_STR + 10;
25 device_info +=
"|Reset Reason: ";
26 device_info += reset_reason;
27 device_info +=
"|Chip Name: ";
28 device_info += lt_cpu_get_model_name();
29 device_info +=
"|Chip ID: 0x" +
format_hex(lt_cpu_get_mac_id());
30 device_info +=
"|Flash: " +
to_string(lt_flash_get_size() / 1024) +
" KiB";
31 device_info +=
"|RAM: " +
to_string(lt_ram_get_size() / 1024) +
" KiB";
std::string format_hex(const uint8_t *data, size_t length)
Format the byte array data of length len in lowercased hex.
void get_device_info_(std::string &device_info)
void publish_state(float state)
Publish a new state to the front-end.
uint32_t get_free_heap_()
std::string to_string(int value)
std::string get_reset_reason_()
Implementation of SPI Controller mode.
sensor::Sensor * block_sensor_