feat: add settings components and persistence tests#80
Conversation
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
| .callback = &dim_timer_callback, | ||
| .arg = state, | ||
| .name = "ui_dim", | ||
| }; | ||
| esp_err_t err = esp_timer_create(&args, &s_dim_timer); |
There was a problem hiding this comment.
[P1] Update dim timer arg when scheduling new state
The dimming timer is created only once (if (!s_dim_timer)) and the callback argument is fixed to the first settings_ui_runtime_t passed in (.arg = state). Subsequent calls with a different state reuse the same timer without updating its argument, so when the timer fires it writes dimming_active to the stale struct and may dereference freed memory if the original state has gone out of scope. Consider deleting and recreating the timer or calling esp_timer_set_arg whenever a new state is scheduled.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68cd143030c48324842552720f2001e7