mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 16:20:42 +00:00
Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
26 lines
783 B
YAML
26 lines
783 B
YAML
esphome:
|
|
name: safe-mode-loop-runs
|
|
|
|
host:
|
|
|
|
logger:
|
|
|
|
safe_mode:
|
|
num_attempts: 10
|
|
on_safe_mode:
|
|
- lambda: |-
|
|
// Spawn a detached thread that logs a unique marker. The
|
|
// non-main-thread log goes through the task log buffer, which
|
|
// is only drained by Logger::loop(). If looping components
|
|
// weren't initialized (the bug fixed in #16269), the buffer is
|
|
// never read and the marker never reaches the console.
|
|
struct MarkerThread {
|
|
static void *thread_func(void *) {
|
|
ESP_LOGI("safe_mode_test", "looping component ran in safe mode");
|
|
return nullptr;
|
|
}
|
|
};
|
|
pthread_t t;
|
|
pthread_create(&t, nullptr, MarkerThread::thread_func, nullptr);
|
|
pthread_detach(t);
|