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

Use nbgl shared functions #768

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nroggeman-ledger
Copy link
Contributor

@nroggeman-ledger nroggeman-ledger commented Sep 17, 2024

Description

The goal of this PR is to reduce the size in Flash (and RAM) of Applications, by sharing all low-level functions of NBGL with the OS:

  • Object management
  • Touchscreen management
  • Screens management

The architecture/Design document can be found in https://ledgerhq.atlassian.net/wiki/spaces/FW/pages/4750966807/BOLOS+Apps+-+Arch+-+NBGL+sharing+between+FW+and+Apps

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Tests
  • Documentation
  • Other (for changes that might not fit in any category)

Breaking changes

For apps non using standard makefiles, there may be some risks if NBGL low-level files are compiled.
Speculos won't work. Use API LEVEL 22

@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.

Project coverage is 35.49%. Comparing base (cb5cfae) to head (621b9be).

Files with missing lines Patch % Lines
lib_nbgl/src/nbgl_obj.c 10.00% 9 Missing ⚠️
lib_nbgl/src/nbgl_screen.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
- Coverage   35.76%   35.49%   -0.28%     
==========================================
  Files          13       13              
  Lines        1591     1606      +15     
==========================================
+ Hits          569      570       +1     
- Misses       1022     1036      +14     
Flag Coverage Δ
unittests 35.49% <9.09%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nroggeman-ledger nroggeman-ledger changed the title WIP: Use nbgl shared functions Use nbgl shared functions Oct 2, 2024
void nbgl_touchHandler(bool fromUx, nbgl_touchStatePosition_t *touchEvent, uint32_t currentTimeMs);
bool nbgl_touchGetTouchedPosition(nbgl_obj_t *obj,
nbgl_touchStatePosition_t **firstPos,
nbgl_touchStatePosition_t **lastPos);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to have separate contexts for ux and apps ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As explained in the architecture document, UX and App are now sharing many variables, but for the communication between App and UX (event forwarding and ability to use events in App), it's sometime necessary to know the number of screens consumed by UX, or, for Touch management, to have separated contexts, to compute NBGL Touch Events (touch duration for example)

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

Successfully merging this pull request may close these issues.

4 participants