Skip to content

ucpd: Add "attached" state callback for CC state changes - #3868

Merged
HiFiPhile merged 3 commits into
hathach:masterfrom
michaelajax:add-ucpd-attached-callback
Sep 1, 2026
Merged

ucpd: Add "attached" state callback for CC state changes#3868
HiFiPhile merged 3 commits into
hathach:masterfrom
michaelajax:add-ucpd-attached-callback

Conversation

@michaelajax

@michaelajax michaelajax commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This is a simple change to define a new callback in the USB-C sink implementation, so that the user application can know when attach state of the cable changes. This was needed in my application to track PD events.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e3c2faed4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/typec/usbc.c Outdated
@github-actions

Copy link
Copy Markdown

Hardware-in-the-loop (HIL) Test Report

No HIL run for this push (no affected boards, or hardware testing did not run).

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Size Difference Report

Because TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds.

Note: If there is no change, only one value is shown.

Changes >1% in size

file .text .rodata .data .bss size % diff
usbc.c 500 ➙ 546 (+46) 2 20 166 ➙ 167 (+1) 688 ➙ 735 (+47) +6.8%
TOTAL 500 ➙ 546 (+46) 2 20 166 ➙ 167 (+1) 688 ➙ 735 (+47) +6.8%
Changes <1% in size

No entries.

No changes
file .text .rodata .data .bss size % diff
tusb_fifo.c 873 0 0 0 873 +0.0%
typec_stm32.c 1230 8 2 19 1255 +0.0%
TOTAL 2103 8 2 19 2128 +0.0%

Scoped compare: 2 (board, example) pairs across b_g474e_dpow1, b_u585i_iot2a.
Not compared (missing on one side): 76 pairs - b_g474e_dpow1:device/audio_4_channel_mic, b_g474e_dpow1:device/audio_4_channel_mic_freertos, b_g474e_dpow1:device/audio_test, b_g474e_dpow1:device/audio_test_freertos, b_g474e_dpow1:device/audio_test_multi_rate, b_g474e_dpow1:device/board_test, b_g474e_dpow1:device/cdc_dual_ports, b_g474e_dpow1:device/cdc_msc, b_g474e_dpow1:device/cdc_msc_freertos, b_g474e_dpow1:device/cdc_msc_throughput, b_g474e_dpow1:device/cdc_uac2, b_g474e_dpow1:device/dfu, b_g474e_dpow1:device/dfu_runtime, b_g474e_dpow1:device/dynamic_configuration, b_g474e_dpow1:device/hid_boot_interface, b_g474e_dpow1:device/hid_composite, b_g474e_dpow1:device/hid_composite_freertos, b_g474e_dpow1:device/hid_generic_inout, b_g474e_dpow1:device/hid_multiple_interface, b_g474e_dpow1:device/midi2_device, ... and 56 more (see the code-metrics job log).

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

Top 2 targets by memory change (%) (out of 78 targets) View Project Dashboard →

target .text .rodata .data .bss total % diff
b_g474e_dpow1/power_delivery 13,912 → 13,960 (+48) 14,856 → 14,904 (+48) +0.3%
b_u585i_iot2a/power_delivery 21,104 → 21,152 (+48) 22,336 → 22,384 (+48) +0.2%

…onnected->connected or connected->disconnected
@michaelajax

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: aa535e8268

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@HiFiPhile HiFiPhile left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@HiFiPhile
HiFiPhile merged commit c588e2e into hathach:master Sep 1, 2026
41 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.

2 participants