Skip to content

Implement teardown lifecycle contract for ESPCpuMonitor#1

Merged
zekageri merged 1 commit intomainfrom
codex/teardown-contract-esp-cpumonitor
Feb 24, 2026
Merged

Implement teardown lifecycle contract for ESPCpuMonitor#1
zekageri merged 1 commit intomainfrom
codex/teardown-contract-esp-cpumonitor

Conversation

@zekageri
Copy link
Collaborator

Summary

  • add isInitialized() to ESPCpuMonitor as a constant-time ownership check
  • harden deinit() teardown by clearing runtime-owned callback/history state and resetting smoothing/temperature state
  • guard sampling paths (sampleNow and timer callback) with initialized-state checks
  • add on-device lifecycle tests for pre-init deinit, repeated deinit, re-init, and destructor cleanup
  • document teardown usage and lifecycle guarantees in README
  • add PlatformIO test runner config for on-device tests

Notes

  • host-side execution of these tests is intentionally disabled because this library depends on ESP32 FreeRTOS idle hooks and esp_timer
  • no backward-compatibility aliases were added per request

@zekageri zekageri merged commit 92f81c0 into main Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant