Changelog

# ChangeLog

## v0.9.0

* Set both zero-resolved debounce defaults to one frame for single- and
  multi-frequency configurations. Explicit debounce values remain unchanged;
  noisy and multi-channel safety multipliers still apply.
* Remove the former auxiliary protection controls from the public
  `fsm_config_t`. Noise uses a private 20-frame window and a topology-independent
  base of `threshold_active / 5`, with no new public tuning field.
* Remove the former `baseline_track_threshold` and EMI configuration/runtime
  protection path; baseline tracking remains a fixed slow, bidirectional
  estimator and callers must rebuild against the current interface.

### Features and behavior

* Process complete one- to three-frequency raw frames through per-frequency
  baseline subtraction, sensitivity normalization, same-frame median fusion,
  fused limiting, and fused time smoothing.
* Support polling and ISR-safe user-push input, debounced state callbacks,
  and topology-aware defaults through `touch_sensor_fsm_get_default_config()`.
* Configure per-channel `threshold_active` and `threshold_inactive` in
  normalized counts. A NULL inactive array or zero entry defaults to integer
  active / 2. Noise compensation raises only the active threshold and keeps
  the strict press comparison reachable below the positive fused limit.
* Return signed fused-filtered data through
  `touch_sensor_fsm_get_data(..., int32_t *data)`. Negative observations are
  preserved; values outside int32_t range saturate at the API boundary.
* Track raw baselines bidirectionally at no more than one count per 500 ms,
  with fixed-point remainder and no touch-state lock or long-press absorption.
* Learn signed fused-filtered noise from complete idle, quiet windows while
  raw baseline tracking continues at its fixed rate.
* Deep-copy configuration arrays, validate ranges and duplicate channels,
  clear the output handle on creation failure, and release a published press
  at most once when stopping or resetting.
* Publish component source, add ESP32-S31 support, and require ESP-IDF 5.5
  or later with `touch_sensor_lowlevel` ^1.0.1. Validate SDK 5.5, 6.0 and 6.1
  through the CI matrix, with deterministic Linux regression tests.
* Add `examples/fsm`, including sample count/period discovery and an explicit
  P4 laboratory configuration for static captures.

### Interface privacy

* Move internal snapshots, effective-configuration queries and CSV macros to
  `private_include/touch_sensor_fsm_private.h`. These are internal interfaces,
  declared and compiled only with `CONFIG_TOUCH_SENSOR_FSM_DEBUG` (default off).
* Keep synchronization and logging implementation macros out of the public
  header. Normal application state/data queries do not require diagnostics.
* Preserve ESP-IDF/Doxygen API documentation. Private headers remain in source
  packages for compilation; moving declarations alone does not conceal source.

### Breaking changes and migration

* Replace `threshold`/`hysteresis` with active/inactive arrays. The comparison
  boundaries change: old threshold 70 with hysteresis 10 meant active 80 and
  inactive 60; new active 70 with default inactive means active 70/inactive 35.
* Use an `int32_t` output variable for FSM `get_data()`. Event callback data
  remains the non-negative amplitude. STOP and RESET clear the processed value.
* Migrate diagnostic consumers to the private debug interface or use public
  state/data queries; rebuild all callers against the new structures.
* Remove `baseline_coef`, `baseline_recover_coef`, `long_press_samples`,
  `baseline_hold`, `baseline_locked`, `press_timer`, `baseline_recovering`,
  `long_press_absorb_count`, and obsolete per-frequency smooth diagnostics.
  The old `reset_cover_time` and `reset_negative_time` mechanisms have no
  replacement timeout. No compatibility placeholders remain.
* Residual, active/inactive threshold, limit and noise diagnostics use the
  sensitivity-normalized decision domain. Limiter overrides retain their
  documented permille units and resolve at startup; the noise base is private
  and equals `threshold_active / 5` with a minimum of one count.
* Replace `polling_interval` with `sample_period_ms`; zero preserves unknown
  timing semantics. Old scale and initialization-count fields are internal.
* Build and distribute component source; the prebuilt library fallback is
  no longer supported.

## v0.8.2 - 2026-02-09

* Add esp32h4 support

## v0.8.1~1 - 2025-06-11

* Export IDF 5.5 libs

## v0.8.1 - 2025-06-11

* Improve ISR concurrency safety and data handling
* Improve operation after changes in the touch environment
* Add IDF 5.5 support

## v0.8.0 - 2025-05-27

* Improve processing performance

## v0.7.0 - 2025-03-28

* Change noise_p and noise_n from single values to per-channel arrays

## v0.6.2 - 2025-03-26

* Support IDF 5.4

## v0.6.1 - 2025-03-25

* Make calibration times configurable

## v0.6.0 - 2025-03-24

* Support ESP32

## v0.5.3 - 2025-03-10

* Make negative logic configurable, set NULL to not use it

## v0.5.2 - 2025-02-28

* Support set Max and Min limits to 0, which means no limit

## v0.5.1 - 2025-02-18

* Fix build with libs

## v0.5.0 - 2025-02-17

* Report data value in fsm_state_cb_t callback

## v0.4.0 - 2025-01-23

* Refactor test code

## v0.3.1 - 2025-01-19

* fix library import bug

## v0.2.0 - 2025-01-18

* fix multiple channels bug
* fix printf bug
* support for linux testing
* support for simulation analysis

## v0.1.0 - 2024-12-27

* Add Initial version of the touch sensor FSM