1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Separate OSD warnings from OSD task and make available via MSP

Provides a properly implemented way for MSP query type OSD implementations (like DJI) to display OSD warnings. Separates the warnings generation from the OSD task and shares common code to make the text available for the OSD and/or via MSP. Eliminates the need to implement hacks and workarounds like using the `CRAFT_NAME` field to display warnings. Since the warnings logic is now separate, the OSD task does not need to be running unlike other hacks.

Adds the `MSP2_GET_OSD_WARNINGS` message formatted as follows:
```
byte  description
0     Display attributes including blink (see displayPortAttr_e in drivers/display.h)
1     Length of warning text
2-n   Warning text characters
```
This commit is contained in:
Bruce Luckcuck 2021-02-13 10:37:53 -05:00
parent 21eea5db21
commit 84b6730cdd
9 changed files with 417 additions and 288 deletions

View file

@ -28,39 +28,40 @@ extern "C" {
#include "blackbox/blackbox.h"
#include "blackbox/blackbox_io.h"
#include "config/feature.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"
#include "pg/rx.h"
#include "common/time.h"
#include "config/config.h"
#include "config/feature.h"
#include "drivers/osd_symbols.h"
#include "drivers/persistent.h"
#include "drivers/serial.h"
#include "config/config.h"
#include "fc/core.h"
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "flight/gps_rescue.h"
#include "flight/pid.h"
#include "flight/imu.h"
#include "flight/mixer.h"
#include "flight/pid.h"
#include "io/beeper.h"
#include "io/gps.h"
#include "osd/osd.h"
#include "osd/osd_elements.h"
#include "osd/osd_warnings.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"
#include "pg/rx.h"
#include "sensors/acceleration.h"
#include "sensors/battery.h"
#include "rx/rx.h"
#include "flight/mixer.h"
void osdRefresh(timeUs_t currentTimeUs);
void osdFormatTime(char * buff, osd_timer_precision_e precision, timeUs_t time);