Skip to content

Use a config struct instead of many arguments for display constructors #10528

@dhalbert

Description

@dhalbert

Some display constructors can take a lot of arguments:

  • common_hal_rgbmatrix_rgbmatrix_construct() -- 15 args
  • common_hal_busdisplay_busdisplay_construct() -- 28 args
  • common_hal_epaperdisplay_epaperdisplay_construct() -- 35 (soon 36) args

Since C doesn't have default arg values or keywords args, the arg lists are quite unwieldy.

I propose creating a struct to pass to these constructors. The struct could be initialized with named fields, and many could be omitted if the default values are zero.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions