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

chore: fix constness to avoid having constants in data segment #2993

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

raphaelcoeffic
Copy link
Member

@raphaelcoeffic raphaelcoeffic commented Jan 6, 2023

.... and thus free around 3KB precious RAM.

Requires EdgeTX/libopenui#84

X7

*** X7 before ***

Section Details:
section              size(B)         addr   loc
.text                 466272   0x08000000   Flash
.ARM                       8   0x08071d60   Flash
.init_array               52   0x08071d68   Flash
.fini_array                4   0x08071d9c   Flash
.data (added)           3544   0x08071da0   Flash
.data                   3544   0x20000000   SRAM1
.bss                   52356   0x20000dd8   SRAM1
._user_heap_stack       1024   0x2000da5c   SRAM1

Totals         KB    usage  of ttl	KB free
  Flash:   458.87   89.62%     512	  53.13
  SRAM1:    55.59   49.63%     112	  56.41
  SRAM2:     0.00    0.00%      16	  16.00


*** X7 after ***

Section Details:
section              size(B)         addr   loc
.text                 469388   0x08000000   Flash
.ARM                       8   0x0807298c   Flash
.init_array               52   0x08072994   Flash
.fini_array                4   0x080729c8   Flash
.data (added)            428   0x080729cc   Flash
.data                    428   0x20000000   SRAM1
.bss                   52356   0x200001b0   SRAM1
._user_heap_stack       1024   0x2000ce34   SRAM1

Totals         KB    usage  of ttl	KB free
  Flash:   458.87   89.62%     512	  53.13
  SRAM1:    52.55   46.92%     112	  59.45
  SRAM2:     0.00    0.00%      16	  16.00

==> 3116 bytes free SRAM more!

TPRO

*** TPRO before ***

Section Details:
section              size(B)         addr   loc
.text                 491112   0x08000000   Flash
.ARM                       8   0x08077e68   Flash
.init_array               48   0x08077e70   Flash
.fini_array                4   0x08077ea0   Flash
.data (added)           3664   0x08077ea4   Flash
.data                   3664   0x20000000   SRAM1
.bss                   57356   0x20000e50   SRAM1
._user_heap_stack       1024   0x2000ee5c   SRAM1

Totals         KB    usage  of ttl	KB free
  Flash:   483.24   94.38%     512	  28.76
  SRAM1:    60.59   54.10%     112	  51.41
  SRAM2:     0.00    0.00%      16	  16.00

*** TPRO after ***

Section Details:
section              size(B)         addr   loc
.text                 494316   0x08000000   Flash
.ARM                       8   0x08078aec   Flash
.init_array               48   0x08078af4   Flash
.fini_array                4   0x08078b24   Flash
.data (added)            460   0x08078b28   Flash
.data                    460   0x20000000   SRAM1
.bss                   57356   0x200001d0   SRAM1
._user_heap_stack       1024   0x2000e1dc   SRAM1

Totals         KB    usage  of ttl	KB free
  Flash:   483.24   94.38%     512	  28.76
  SRAM1:    57.46   51.30%     112	  54.54
  SRAM2:     0.00    0.00%      16	  16.00

==> 3204 bytes free SRAM more!

@pfeerick pfeerick added this to the 2.9 milestone Jan 8, 2023
@pfeerick pfeerick self-assigned this Jan 17, 2023
@pfeerick
Copy link
Member

pfeerick commented Jan 18, 2023

It seems like double that on the radio itself... compared with PR 2990, with this PR the X9D+ went from 60836 free mem to 67036 (per the statistics/debug page), and T-Pro went from 67828 to 71024 😮 Negligible effect on the TX16S from 5307736 became 5307564 - a reduction of 172 bytes 😆 - but who cares with that much of the 8Mb SDRAM still free (as well as being understandable as most of the changes were in B&W UI code).

@pfeerick pfeerick merged commit acd95df into main Jan 18, 2023
@pfeerick pfeerick deleted the fix-const-data branch January 18, 2023 10:12
@pfeerick pfeerick added enhancement ✨ New feature or request B&W Related generally to black and white LCD radios labels Jan 18, 2023
pfeerick pushed a commit that referenced this pull request Jan 25, 2023
fix constness to avoid having constants in data segment 
.... and thus free some precious RAM
@pfeerick pfeerick modified the milestones: 2.9, 2.8.1 Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B&W Related generally to black and white LCD radios enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants