Skip to content
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

noMacros example should also show how to incorporate inputs and outputs without macros #429

Open
ScruffR opened this issue Oct 4, 2023 · 0 comments

Comments

@ScruffR
Copy link

ScruffR commented Oct 4, 2023

In order to have a comprehensive noMacros example it would be really good to see how to add (at least) two inputs (e.g. Serial and button) and two outputs (e.g. Serial and ADAGFX_OUT) without macros.

While the macros are really helpful for writing concise code it's quite complicated to follow the logic what's going on behind the scene.
For that it would be great to have a full-fledged example to understand the bare metal.

That would greatly help and maybe even kick-start possible contributions to extend support for special needs.

i.e. I was trying to have multi font support for AdafruitGfx displays (e.g. ILI9341) but had a hard time to pass in the respective fontMarginY values via the MENU_OUT or ADAGFX_OUT macros.
Currently I'm doing it after the fact like this 🤮

  ((gfxOut*)(out.outs[0]))->resY = font.yAdvance;
  ((gfxOut*)(out.outs[0]))->fontMarginY = value;  // value derived from max(font.glyph[i].yOffset)

If I knew how to incorporate this properly into adafruitGfxOut.h and maybe even adapt the ADAGFX_OUT macro to support the extended constructor I'd file a PR.

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

No branches or pull requests

1 participant