-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime Configuration of EVE_HAS_GT911? #34
Comments
Hmm, normally I would just add more profiles for different vendors and especially the "Resolution_xxx" blocks for standard timings allow very short configurations. But it sounds like you are using just the panels? So you are not using one of the modules that already includes a FT81x / BT81x? There is a different way for this, with the version I put in the 5.x branch yesterday the define for the selected panel is gone from EVE_config,h to allow for configuration of the panel without the need to edit the file. Take this configuration for example: #define EVE_PCLK (2L) Instead of setting the define EVE_EVE3_50G) or EVE_EVE3_70G you could just set all the defines Also I could add generic profiles like this: #if defined (EVE_GENERIC_800X480) #if !defined (EVE_PCLK) #if !defined (EVE_PCLK_FREQ) #if !defined (EVE_PCLKPOL) #if !defined (EVE_SWIZZLE) #if !defined (EVE_CSPREAD) #if !defined (EVE_GEN) /* these need to be set externally if required: So you would only need to provided the defines that are different. |
Thanks Rudolph. Perhaps I didn't explain this well enough - It's not an issue of where in the code those #defines are located - it's an issue of the configuration defines being compile-time parameters that lock in the program behavior. The software after compilation is only compatible with one display - the display that was configured at compile time. Instead, I'm proposing a change that lets one piece of the display configuration be runtime configurable, so that one software build can be used with multiple similar hardware displays, without requiring the software to be reconfigured (editing defines) and recompiled/reloaded. For example, using the displays you mentioned- But if that one differing parameter (EVE_HAS_GT911) was runtime modifiable, then a device's software could selectively enable it as needed - for example, set at startup based on a DIP switch value - so that the device could support multiple display types from a singular software load. |
I see, having one software to support more than one display makes more sense in this context. Like this: EVE_init_runtime(EVE_INIT_STRUCT_T st_eve_init) Any maybe make this the only EVE_init() later? |
Hmm, I do have this now: typedef struct But I just realized two things. And "has_gt911" on it's own would mean that the binary blob for generation 2 GT911 support would always end up at in generation 2 binaries since the optimizer could not determine anymore if it is actually used or not. Oh, annother thing, having EVE_HSIZE and EVE_VSIZE available globally also is rather nice. This is getting a bit more complicated than I anticipated. :-) |
Thanks Rudolph. I like your idea - I think it gives the software a lot more flexibility, and the use of the second version of the init function, in parallel to the original, makes sense and would be quite useful. I had thought about the gt911 binary blob - the way I made my change in the first post should handle this. If a user didn't need gt911 support for any of their target displays, they would leave EVE_HAS_GT911 undefined and save on memory. But if they might need it, to be determined conditionally later at runtime, then they would define EVE_HAS_GT911 so it was available in the compiled executable. I think you would be just fine to do something similar with your structure - keep it how you have it, but also keep the binary blob behind the #define statement. That way the users can leave it out if they know they won't need it, or include it if they do (or think they might). For the EVE generation, that might also be somewhat self-solving? For example, if I want to provision a system for runtime selection between two different displays, one of which is EVE2, and one EVE4, I'm already going to be limiting myself to the EVE2 feature set for compatibility, otherwise I have to write two different versions of the user interface. If the EVE4 display will function as expected when the EVE2 generation is defined (I haven't tried this, but the datasheets seem to indicate it will work?), then your plan to leave EVE_GEN as a #define should be A-OK. The user would just set this to the oldest generation they planned to use, and it wouldn't otherwise be necessary to make any runtime changes to this. One more wildcard question: |
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
block and wrap it in a conditional:
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.
The text was updated successfully, but these errors were encountered: