Skip to content

Conversation

klutvott123
Copy link
Member

@klutvott123 klutvott123 commented Dec 8, 2019

Unloads background when ui is visible. It's prevented from running anyway.
Removed optional init function.
+ some minor simplifications.
Saves around 2KB for telemetry script.
This means that background will redetect apiVersion and set the time when it's loaded again. But that's ok IMO.

Also separated event handling from lcd draw code for the main menu.

+ some other minor changes.

Have tested this and everything works as it should.

mikeller
mikeller previously approved these changes Dec 9, 2019
Unloads background when ui is visible. It's prevented from running anyway.
Removed optional init function.
+ some minor simplifications.
Saves around 2KB for telemetry script.

Reference tables instead of copying

No need to make actual copies of these tables.
Saves a little bit of memory and some cpu cycles.

Separate main menu event handling from draw code

Rename incLine to incField

incValue fix

Avoid potential nil divided by scale if for some reason min/max doesn't exist.

Make ui.lua functions local

They're only used in this file
@mikeller mikeller added this to the 1.5 milestone Dec 9, 2019
@mikeller mikeller merged commit f78dba8 into betaflight:master Dec 9, 2019
@klutvott123 klutvott123 deleted the more-memory-saving branch February 5, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants