Skip to content

Runtime Configuration of EVE_HAS_GT911? #34

@dstulken

Description

@dstulken

Rudolph-

A small library modification for your consideration.

As I'm sure you are familiar with, component shortages have thrown a wrench in many product lines this year. Matrix Orbital in particular seems to have been hit hard, and while looking for second sources, I've noticed that in some cases, equivalent displays from other manufacturers are quite similar- with compatible (or adaptable) pinouts, timings, and mechanical form factors. But the software hiccup of the hardcoded Goodix touch controller configuration makes these displays incompatible from a software perspective, unless a different software build is created for each display type used.

To avoid this, what I've tested locally is a simple change to EVE_commands.c and EVE_commands.h.

In EVE_commands.h, the init function changes from:
uint8_t EVE_init(void);
to
uint8_t EVE_init(bool hasGT911);

and in the revised EVE_init(bool hasGT911) function in EVE_commands.c, we simply take the

    #if defined (EVE_HAS_GT911)
    ...
    #endif

block and wrap it in a conditional:

   if (hasGT911)
   {
       #if defined (EVE_HAS_GT911)
       ...
       #endif
   }

Then for any "flexible" display configuration desired, "EVE_HAS_GT911" would be defined in the display profile in EVE_config.h (to make it "available"), and then this could either be used or not used as desired at runtime, as determined by the hasGT911 parameter when EVE_init is called, allowing both types of displays to be used without requiring separate software builds.

Thoughts?
Or is there a better way to do this?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions