-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use coloured fonts if supported #13005
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
Conversation
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
AUTOMERGE: (FAIL)
|
I suppose this is not a public version, so this PR can't be tested until published. How this works? It's able to colour a custom font uploaded or only valid for preinstalled font? |
Correct, not publicly available. This is recorded in this PR for the record. See https://betaflight.com/docs/development/API/DisplayPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good apart from config calls. Please evaluate if they are costly, if yes, I recommend local const initialization of those values.
const int16_t osdRssiDbm = getRssiDbm(); | ||
static bool diversity = false; | ||
|
||
if (osdRssiDbm < osdConfig()->rssi_dbm_alarm) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this runs in the loop, I would load the config value in the init function, as config calls are expensive correct?
There are couple of config calls, I think we should initialize the all in a local variable in init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These setting can be changed on the fly outside of initialisation. Config access is considered low cost as it's held in RAM. osdConfig()->
appears in https://github.com/betaflight/betaflight/blob/321fd468fd2f3be78681d45e3e578cd768c3f26c/src/main/osd/osd_elements.c 53 times for such comparisons, or, for example, determining which unit symbols to display.
It’s been reported that WTFOS is currently confused by this update. The simple workaround is to set |
Thanks |
You are my hero. |
Use coloured fonts if possible.
Display RSSI dBm as critical if below threshold.
Display all RX related warnings as critical.
Tested on WS firmware 34.40.12.
https://youtu.be/HkRrbCb4Vl8