Skip to content

cleanup - #37

Open
WantClue wants to merge 1 commit into
mainfrom
cleanup
Open

cleanup#37
WantClue wants to merge 1 commit into
mainfrom
cleanup

Conversation

@WantClue

@WantClue WantClue commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Updated button handling with interrupt-based input, press debouncing, long-press detection, and click callbacks.
  • Removed Features

    • Removed the display and screen interface, including on-device UI pages, status displays, self-test messages, and firmware-update screens.
    • Removed screen-related API settings for flipping and inverting the display.
  • Bug Fixes

    • Improved self-test startup sequencing and error reporting when no display is available.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e073896-405a-4980-aaa1-8bb17f97d875

📥 Commits

Reviewing files that changed from the base of the PR and between 49c1b00 and 5f06c69.

📒 Files selected for processing (15)
  • main/CMakeLists.txt
  • main/HMI/inc/display.h
  • main/HMI/inc/input.h
  • main/HMI/inc/screen.h
  • main/HMI/src/display.c
  • main/HMI/src/input.c
  • main/HMI/src/screen.c
  • main/global_state.h
  • main/http_server/openapi.yaml
  • main/idf_component.yml
  • main/lv_conf.h
  • main/lv_font_portfolio-6x8.c
  • main/self_test/self_test.c
  • main/system.c
  • sdkconfig.defaults
 _________________________________________________________________________________________________________________
< Estimate the order of your algorithms. Get a feel for how long things are likely to take before you write code. >
 -----------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@main/HMI/src/input.c`:
- Around line 95-99: Update input_init around button_task_handle creation and
gpio_isr_handler_add so a failed ISR registration deletes the created task,
clears button_task_handle, and restores the initialization state before
returning the error; preserve the existing success path.

In `@main/self_test/self_test.c`:
- Around line 309-311: Update the input initialization branch in self-test setup
around input_init so an ESP_OK failure enters a recovery path that does not rely
on reset_self_test or button input, rather than merely logging and continuing.
Ensure BootSemaphore can still be released and the self-test cannot block
indefinitely before proceeding.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e073896-405a-4980-aaa1-8bb17f97d875

📥 Commits

Reviewing files that changed from the base of the PR and between 49c1b00 and 5f06c69.

📒 Files selected for processing (15)
  • main/CMakeLists.txt
  • main/HMI/inc/display.h
  • main/HMI/inc/input.h
  • main/HMI/inc/screen.h
  • main/HMI/src/display.c
  • main/HMI/src/input.c
  • main/HMI/src/screen.c
  • main/global_state.h
  • main/http_server/openapi.yaml
  • main/idf_component.yml
  • main/lv_conf.h
  • main/lv_font_portfolio-6x8.c
  • main/self_test/self_test.c
  • main/system.c
  • sdkconfig.defaults
💤 Files with no reviewable changes (12)
  • main/HMI/inc/display.h
  • main/idf_component.yml
  • main/lv_font_portfolio-6x8.c
  • main/system.c
  • main/CMakeLists.txt
  • sdkconfig.defaults
  • main/HMI/src/screen.c
  • main/lv_conf.h
  • main/HMI/inc/screen.h
  • main/HMI/src/display.c
  • main/http_server/openapi.yaml
  • main/global_state.h

Comment thread main/HMI/src/input.c
Comment on lines +95 to +99
// Task has to exist before the ISR can notify it
ESP_RETURN_ON_FALSE(xTaskCreate(button_task, "button", 3072, NULL, 5, &button_task_handle) == pdPASS,
ESP_ERR_NO_MEM, TAG, "Failed to create button task");

ESP_RETURN_ON_ERROR(gpio_isr_handler_add(GPIO_BUTTON_BOOT, button_isr_handler, NULL), TAG, "Error adding ISR handler");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Roll back the task when ISR handler registration fails.

xTaskCreate succeeds before gpio_isr_handler_add. If handler registration fails, input_init returns an error but leaves button_task blocked forever with its allocated stack. Delete the task and restore initialization state before returning the error.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@main/HMI/src/input.c` around lines 95 - 99, Update input_init around
button_task_handle creation and gpio_isr_handler_add so a failed ISR
registration deletes the created task, clears button_task_handle, and restores
the initialization state before returning the error; preserve the existing
success path.

Comment on lines +309 to +311
if (input_init(NULL, reset_self_test) != ESP_OK) {
ESP_LOGE(TAG, "Input init failed!");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Do not continue after input_init fails.

This branch only logs the error and continues. A later failed test calls tests_done, which waits for reset_self_test to release BootSemaphore. input_init failed, so that callback path is unavailable and the device can remain blocked indefinitely. Use a recovery path that does not depend on button input before continuing.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@main/self_test/self_test.c` around lines 309 - 311, Update the input
initialization branch in self-test setup around input_init so an ESP_OK failure
enters a recovery path that does not rely on reset_self_test or button input,
rather than merely logging and continuing. Ensure BootSemaphore can still be
released and the self-test cannot block indefinitely before proceeding.

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