Skip to content

Added default value protection for line coding parameters in serial Host classes#257

Merged
fdesbiens merged 1 commit intoeclipse-threadx:devfrom
ayedm1:default_value_protection
Apr 17, 2026
Merged

Added default value protection for line coding parameters in serial Host classes#257
fdesbiens merged 1 commit intoeclipse-threadx:devfrom
ayedm1:default_value_protection

Conversation

@ayedm1
Copy link
Copy Markdown
Contributor

@ayedm1 ayedm1 commented Mar 25, 2026

Add preprocessor guards to allow customization of default line coding parameters.

Summary of Changes:

  • Wrapped default line coding constants (RATE, STOP_BIT, PARITY, DATA_BIT) with #ifndef guards in CDC ACM, GSER, and Prolific host class headers
  • This allows users to define custom default values before including these headers in (ux_user.h)
  • Updated Prolific activation code to use DEFAULT constants instead of hardcoded values for consistency and better maintainability

Files Modified:

  • common/usbx_host_classes/inc/ux_host_class_cdc_acm.h
  • common/usbx_host_classes/inc/ux_host_class_gser.h
  • common/usbx_host_classes/inc/ux_host_class_prolific.h
  • common/usbx_host_classes/src/ux_host_class_prolific_activate.c

…t classes

Add preprocessor guards to allow customization of default line coding parameters.

Summary of Changes:
- Wrapped default line coding constants (RATE, STOP_BIT, PARITY, DATA_BIT)
  with #ifndef guards in CDC ACM, GSER, and Prolific host class headers
- This allows users to define custom default values before including these headers in (ux_user.h)
- Updated Prolific activation code to use DEFAULT constants instead of hardcoded values
  for consistency and better maintainability

Files Modified:
- common/usbx_host_classes/inc/ux_host_class_cdc_acm.h
- common/usbx_host_classes/inc/ux_host_class_gser.h
- common/usbx_host_classes/inc/ux_host_class_prolific.h
- common/usbx_host_classes/src/ux_host_class_prolific_activate.c
@ayedm1 ayedm1 moved this to In review in ThreadX Roadmap Mar 25, 2026
@ayedm1 ayedm1 changed the base branch from master to dev March 25, 2026 22:05
@fdesbiens fdesbiens requested a review from rahmanih March 31, 2026 15:36
@rahmanih
Copy link
Copy Markdown
Contributor

rahmanih commented Apr 6, 2026

Hi @ayedm1 ,
I'll have a look on it...

Copy link
Copy Markdown

@ABOUSTM ABOUSTM left a comment

Choose a reason for hiding this comment

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

looks good
thanks

Copy link
Copy Markdown
Contributor

@rahmanih rahmanih left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@rahmanih
Copy link
Copy Markdown
Contributor

@fdesbiens,
could you please proceed with the merge of this PR.

regards
Haithem.

@fdesbiens fdesbiens changed the title Add default value protection for line coding parameters in serial Host classes Added default value protection for line coding parameters in serial Host classes Apr 17, 2026
@fdesbiens fdesbiens merged commit e2e81a8 into eclipse-threadx:dev Apr 17, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in ThreadX Roadmap Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants